Alert
Question: How do I generate an alert message from JavaScript?
Answer: To generate an alert message, use the alert()
method:
alert('Message goes here')
The button above was created using the following code:
<form name=myform>
<input type=button value="Try it now"
onClick="alert('Hello from JavaScript!')">
</form>
JavaScripter.net.
Copyright
© 1999-2006, Alexei Kourbatov