Javascript Tutorial Part-2  

Posted by Kunal Pradhan

Same function as alert

there is another function

"prompt"

prompt is useful to take some value from user


like javascript:prompt("Enter your name");void(0)

here we have written another function void(0) because
when we use javascript browser creates a new page
by writing void(0) we say to browser that we have to do nothing.just run the script and stay at same page


Taken value vis prompt we can store it and use it in future

e.g.

javascript:var a=prompt("Enter your name");alert("Hello "+a+" How are you?");void(0)

in above example we are taking user's name in variable a via prompt and then using it in second alert function

; is used to separate two javascripts


try yourself make your own javascripts using alert,+,variables,prompt

Read all javascript tutorials Click here

This entry was posted on Wednesday, June 18, 2008 and is filed under , . You can leave a response and follow any responses to this entry through the Subscribe to: Post Comments (Atom) .

0 comments