Opening an Alert Box in Javascript
alert() is a built-in Javascript method.
A little tricky here with the quotation marks.
Put what you want the alert to say in double quotation marks if you are using in a script.
alert("Don't Leave My Site!");
Use single quotes if using in a link.
Copy and Paste Javascript (two ways to use):
In a link:
<a href="http://google.com" onClick="alert('You are going to Google!');return true">Google</a>
In a script:
<script type=text/javascript>
<!--
alert("Don't Leave My Site!");
-->
</script>
When using in a link, the "return true" means go to the link that is being clicked on. "return false" would stop from going to the link.
Alert Box - See in Action (new window)
Click HERE to comment or discuss at iLoveTheCode GOOGLE Group