Running a Script from User Action : JavaScript DHTML examples (example source code) » Form Control » Button

JavaScript DHTML
C++
Java Products
Java Articles
JavaScript DHTML Home  »   Form Control   » [  Button  ]   
 



Running a Script from User Action

Please note that some example is only working under IE or Firefox.

<HTML>
<HEAD>
<TITLE>An onClick script</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function alertUser() {
    alert("Ouch!")
}
// -->
</SCRIPT>
</HEAD>
<BODY>
Here is some body text.
<FORM>
    <INPUT TYPE="text" NAME="entry">
    <INPUT TYPE="button" NAME="oneButton" VALUE="Press Me!" onClick="alertUser()">
</FORM>
</BODY>
</HTML>
Related examples in the same category
1.  Using the onSubmit Event to Cancel a Form Submission (Internet Explorer)
2.   HTML Form with onClick Code
3.  Button set Textfield value
4.  Button click to display dialog
5.  Button Redirect
6.  Create a button
7.  Button to display the name of the form
8.  Button to display the names of all the elements in a form
9.  Animating Buttons with JavaScript
10.   Roll over one of our images.
11.  Button and Check Box Event Handling
12.  JavaScript Button action event
13.  Three Buttons Sharing One Function
14.  Methods and Properties of the Button Object
15.  Putting Script Directly in the onclick Event Handler
16.  Toggle button with hand cursor and image
17.  Button Click action
18.  Button On Click Action
19.  Button timeout








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.