Alert window/pop up help

liunx

Guest
Hey,<br />
<br />
I did a search and the best I could come up with to do what I want is the code at the bottom.<br />
<br />
Basically, I want to have an alert window pop up with a message when a button is clicked.<br />
<br />
So for example someone wants to email me but my email is down, they click the email button and an alert window pops up saying so. I won't use it for anything quite that silly but you get the point.<br />
<br />
The code I have copied here makes the alert box window open at page load. Can it be set to open when clicked? I screwed around with it quite a bit but wasn't able to get anything that worked.<br />
<br />
<html> <br />
<body onload="drawAlert()"> <br />
<SCRIPT LANGUAGE="JavaScript"> <br />
function drawAlert () { <br />
alert ("This is an alert message that can say whatever you want!"); <br />
} <br />
</SCRIPT> <br />
<body> <br />
</html><br />
<br />
Thanks all in advance,<br />
Gord<!--content-->Link: <br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="alert('This is an alert message.'); return false;">E-mail</a><br />
<br />
Button:<br />
<br />
<input type="button" value="E-mail" name="AlertButton" onclick="alert('This is another alert message!');" /><br />
<br />
Try that.<!--content-->It works perfectly, thanks so much.<br />
<br />
Gord<!--content-->You're welcome. ;)<!--content-->
 
Back
Top