Put all your JavaScript statement in onclick clause : onClick « Event onMethod « JavaScript DHTML






Put all your JavaScript statement in onclick clause

   

<html>
<head>
<title>A Simple Page</title>
</head>
<body>
<p onclick="units = prompt('value');alert(units + ' is ' + units * 9.99);">Click here to specify quantity</p>
</body>
</html>

   
    
    
  








Related examples in the same category

1.'onClick' Example
2.Anchor onclick event
3.Running a Script from User Action
4.Add document onclick event handler