DIR Return Create A Forum - Home
---------------------------------------------------------
Code9
HTML https://code9.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: HTML (normal)
*****************************************************
#Post#: 3--------------------------------------------------
Adding JavaScript Alerts to Buttons
By: Connor Date: March 31, 2011, 5:00 am
---------------------------------------------------------
[code]
<html>
<head>
<title>Alert by Connor</title>
<br>
</head>
<center>
<body>
<h1>Linking JavaScript Alerts to Buttons by Connor</h1>
</br>
</br>
</br>
<input type="button" value="CLICK HERE" onClick="doRedirect()">
<script type="text/javascript">
function doRedirect() {
alert("This is an alert");
}
</script>
[/code]
That is the code for the HTML document, wack up a notepad and
add it, and save as a .html file.
To change the alert's text, change the [code]alert("This is an
alert");[/code]
To change the button text, change the [code]value="CLICK
HERE"[/code]
#Post#: 7--------------------------------------------------
Re: Adding JavaScript Alerts to Buttons
By: Nub Date: March 31, 2011, 9:09 am
---------------------------------------------------------
handy guide m8
#Post#: 8--------------------------------------------------
Re: Adding JavaScript Alerts to Buttons
By: CodeDaddy Date: March 31, 2011, 9:10 am
---------------------------------------------------------
nice guide, helps alot of starters
#Post#: 38--------------------------------------------------
Re: Adding JavaScript Alerts to Buttons
By: Connor Date: April 4, 2011, 5:31 pm
---------------------------------------------------------
Thanks lol.
*****************************************************