ads

Wednesday, 24 February 2016

alertbox in javascript

JAVASCRIPT

"ALERT BOX"

syntax:- window.alert()

INPUT:-

OUTPUT:-

java script(head, body ,external)

JAVASCRIPT

javascript is used in three different ways these are :-
  1. HEAD
  2. BODY
  3. EXTERNAL  
3.EXTERNAL:-in external javascript we need to create a two different files.One file is used for external script which is saved on ".js "extension. another file is used for html in which script is used to provide a sourse of external file<script src="filename.js"></script>.
eg:- 


 this file is saved on "ext.js" extension.


in this script src provides the extension of external java script file.

output:-
 

in this program  we enter no. between 1 to 10 for valid case only.lets we enter here any no. like "2" then output shows like this:-



if we enter any no. greater than 10 then this is a invalid case according to our condition.To check for invalid case we enter  any value greater than 10 like"77"



java script(head, body ,external)

JAVASCRIPT

javascript is used in three different ways these are :-
  1. HEAD
  2. BODY
  3. EXTERNAL  
2.BODY:-

output:-
in this program  we enter no. between 1 to 10 for valid case only.lets we enter here any no. like "2" then output shows like this:-
if we enter any no. greater than 10 then this is a invalid case according to our condition.To check for invalid case we enter  any value greater than 10 like"77"

java script(head, body ,external)

JAVASCRIPT

javascript is used in three different ways these are :-
  1. HEAD
  2. BODY
  3. EXTERNAL  
  1. HEAD:- script is used in a head part.
    input:-
    output:-
     

    in this program  we enter no. between 1 to 10 for valid case only.lets we enter here any no. like "2" then output shows like this:-



    if we enter any no. greater than 10 then this is a invalid case according to our condition.To check for invalid case we enter  any value greater than 10 like"77"



conditions in java script

javascript

input:-

in conditional statements we use conditions like:if, if-else,while, do-while etc. in this program according to our condition we apply valid conditional statement.

output:-
in this program  we enter no. between 1 to 10 for valid case only.lets we enter here any no. like "2" then output shows like this:-
if we enter any no. greater than 10 then this is a invalid case according to our condition.To check for invalid case we enter  any value greater than 10 like"77"

COLOR AND SIZE in javascript

JAVASCRIPT 

INPUT:-
Output:-
  

after clicking on click button

 

styles in javascript


javascript


input:-

  

output:-  
after clicking on click button then this following output is shows:-