Ans: Put the JavaScript code alert('Waz up?'); in an onclick attribute.
Ans: In the onclick attribute. In this lecture we will see that JavaScript can also go within script tags in the head or in the body.
Ans: (1) In an alert box, (2) in the status bar, (3) in a text box or (4) in a button caption.
Ans: type, name, size, value, onclick, style.
Ans:
<input type="text" name="txtA" size="10" value="0" />
Ans:
<input type="button" name="btnB" value="Push Me" />
Ans: Here is a webpage that does this.
Ans: Place it between <!-- and -->.
Ans: frmTemperature
Ans: parseFloat
<script type="text/javascript"> ... </script>
operators1 Example
Output: 15 6 9015 17 255 |
operators2 Example
Output: 82 46 7 |
<head> <title>Title goes here</title> <style type="text/css"> ... Document-level style goes here. </style> <script type="text/javascript"> function Convert( ) { var c, f; c = parseFloat(document.frmA.txtC.value); f = 9 * c / 5 + 32; document.frmA.txtF.value = f; } </script> </head>
<input type="button" name="btnConvert" value="Convert" onclick="Convert( );" />Example: Temperature 2 Use event handler functions for JavaScript code.
Ans: See Example 26: distance2.htm.