hitmill.com
link to hitmill.com home page

JavaScript Scripted Button


 

 
This is an example of a JavaScript-coded button. The code you place into the onClick event will determine what the button does when the user clicks on the button. The code for this demonstation has been included for your convenience. The message can be changed in the onClick scripting below. JavaScript purists would say that everything between the two script tags should be in the head section of the HTML document and only the coding between the form tags should be placed where you want the button to be located. Either way works just fine. Study the code, re-code your own onClick event and see what you can get your own buttons to do on your own Web pages. Place the following code where you want the button to be placed.

 
<SCRIPT language="JavaScript">
<!-- Begin hiding contents from older browsers
function ShowMessage(Msg)  {
   alert(Msg)
}
// End hiding the contents -->
</SCRIPT>
<FORM>
<INPUT type=BUTTON value="Push me!" onClick="ShowMessage('Hello')">
</FORM>
 

 

 


 
Contact Webmaster
 
Updated
© hitmill.com
All Rights Reserved