Tuesday, January 5, 2010

How to get a Text box using java script?

prompt() is used to get the text box.

Example:

prompt("Enter your name :");

How to get a Text box using java script?

How to give Alert/Messsge box in JavaScript?

alert('your message to be popped up');

Example:
< input type="button" value="Example" onclick="alert('your message to be popped up');return true" />

If you open this code with the Browser then you can see a button named with "Example".
If you click on it it will popup a message box with the message 'your message to be popped up'.