<!-- Function "startState()" is invoked everytime the webpage is refurbished. --> <!-- Using css to setup the font, size, color of the text. --> <body onload = "startState()"> <!-- Using this table to make view more clear and orderliness. --> <table width="100%"> <tr> <td width="25%" height="67"> </td> <td width="50%" ><p class = "STYLE1">----------------------Simple Calculator------------------</p></td> <td width="25%"> </td> </tr>
<!-- Creat a interlinking to make user go to direction page. --> <tr> <td height="15"> </td> <td> <p class = "STYLE2">Click <a href="direction.html">direction</a> to know the use of each button.</p></td> <td> </td> </tr>
<tr> <td> </td> <td> <!-- Creat a form: name is "content" and method is "post" which is to send --> <!-- information and the location of form script --> <form name = "calculate" action = ""> <!-- Creat a table to display the calculator's appearance. --> <table border = "1" width = "450" cellspacing = "5" summary = "This is a calculator used to calculate simple mathematics operations">
<tbody> <!-- Creat a text and many button. Text is to show the number entered and --> <!-- when button is clicked, different function is invoked. --> <tr> <td colspan = "3" height = "15"> <input name = "screen" type = "text" size = "32" value = "0"></td> <td width = "1" height = "15"></td> <td width = "60" height = "15"> <input name = "showTime" type = "button" value = " 1/x " onclick = "otherCal('r')" /></td> <td width = "60" height = "15"> <input name = "ClareAll" type = "button" value = " C " onclick = "clearAll()" /></td> <td width = "60" height = "15"> <input name = "ClareLine" type = "button" value = " CE " onclick = "clearCur()" /></td> </tr> <tr> <td width = "60" height = "15"> <input name = "seven" type = "button" value = " 7 " onclick = "numberPass('7')" /></td> <td width = "60" height = "15"> <input name = "eight" type = "button" value = " 8 " onclick = "numberPass('8')" /></td> <td width = "60" height = "15"> <input name = "nine" type = "button" value = " 9 " onclick = "numberPass('9')" /></td> <td width = "1" height = "15"></td> <td width = "60" height = "15"> <input name = "OppositeSign" type = "button" value = " +/- " onclick = "otherCal('i')" /></td> <td width = "60" height = "15"> <input name = "percent" type = "button" value = " % " onclick = "otherCal('p')" /></td> <td width = "60" height = "15"> <input name = "StoreCurrentNum" type = "button" value = " MS " onclick = "memeryCal('s')" /></td> </tr>
<tr> <td width = "60" height = "15"> <input name = "four" type = "button" value = " 4 " onclick = "numberPass('4')" /></td> <td width = "60" height = "15"> <input name = "five" type = "button" value = " 5 " onclick = "numberPass('5')" /></td> <td width = "60" height = "15"> <input name = "six" type = "button" value = " 6 " onclick = "numberPass('6')" /></td> <td width = "1" height = "15"></td> <td width = "60" height = "15"> <input name = "AddSign" type = "button" value = " + " onclick = "operatorPass('+')" /></td> <td width = "60" height = "15"> <input name = "SubtructSign" type = "button" value = " - " onclick = "operatorPass('-')" /></td> <td width = "60" height = "15"> <input name = "ClareStoredNum" type = "button" value = " MC " onclick = "memeryCal('c')" /></td> </tr> <tr> <td width = "60" height = "15"> <input name = "one" type = "button" value = " 1 " onclick = "numberPass('1')" /></td> <td width = "60" height = "15"> <input name = "two" type = "button" value = " 2 " onclick = "numberPass('2')" /></td> <td width = "60" height = "15"> <input name = "three" type = "button" value = " 3 " onclick = "numberPass('3')" /></td> <td width = "1" height = "15"></td> <td width = "60" height = "15"> <input name = "MultiplySign" type = "button" value = " * " onclick = "operatorPass('*')" /></td> <td width = "60" height = "15"> <input name = "DivisionSing" type = "button" value = " / " onclick = "operatorPass('/')" /></td> <td width = "60" height = "15"> <input name = "AddStoredNum" type = "button" value = " M+ " onclick = "memeryCal('i')" /></td> </tr> <tr> <td width = "60" height = "15"> <input name = "zero" type = "button" value = " 0 " onclick = "numberPass('0')" /></td> <td width = "60" height = "15"> <input name = "point" type = "button" value = " . " onclick = "otherCal('d')" /></td> <td colspan = "2" height = "15"></td> <td width = "60" height = "15"> <input name = "CloseWindow" type = "button" value = " back " onclick = "window.close()" /></td> <td width = "60" height = "15"> <input name = "equal" type = "button" value = " = " onclick = "getResult()" /></td> <td width = "60" height = "15"> <input name = "SubtructStoredNum" type = "button" value = " M- " onclick = "memeryCal('d')" /></td> </tr></table></form></td> <td> </td></tr> </table> </body>帮忙看下到底是为什么呀,谢谢了
html注释是
<!-- ... -->
js注释是
//...or/*..
*/
<!-- Using css to setup the font, size, color of the text. -->
<body onload = "startState()"> <!-- Using this table to make view more clear and orderliness. -->
<table width="100%">
<tr>
<td width="25%" height="67"> </td>
<td width="50%" ><p class = "STYLE1">----------------------Simple Calculator------------------</p></td>
<td width="25%"> </td>
</tr>
<!-- Creat a interlinking to make user go to direction page. -->
<tr>
<td height="15"> </td>
<td> <p class = "STYLE2">Click <a href="direction.html">direction</a> to know the use of each button.</p></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> <!-- Creat a form: name is "content" and method is "post" which is to send -->
<!-- information and the location of form script -->
<form name = "calculate" action = "">
<!-- Creat a table to display the calculator's appearance. -->
<table border = "1" width = "450" cellspacing = "5"
summary = "This is a calculator used to calculate simple mathematics operations">
<tbody>
<!-- Creat a text and many button. Text is to show the number entered and -->
<!-- when button is clicked, different function is invoked. -->
<tr>
<td colspan = "3" height = "15">
<input name = "screen" type = "text" size = "32" value = "0"></td>
<td width = "1" height = "15"></td>
<td width = "60" height = "15">
<input name = "showTime" type = "button" value = " 1/x "
onclick = "otherCal('r')" /></td>
<td width = "60" height = "15">
<input name = "ClareAll" type = "button" value = " C "
onclick = "clearAll()" /></td>
<td width = "60" height = "15">
<input name = "ClareLine" type = "button" value = " CE "
onclick = "clearCur()" /></td>
</tr> <tr>
<td width = "60" height = "15">
<input name = "seven" type = "button" value = " 7 "
onclick = "numberPass('7')" /></td>
<td width = "60" height = "15">
<input name = "eight" type = "button" value = " 8 "
onclick = "numberPass('8')" /></td>
<td width = "60" height = "15">
<input name = "nine" type = "button" value = " 9 "
onclick = "numberPass('9')" /></td>
<td width = "1" height = "15"></td>
<td width = "60" height = "15">
<input name = "OppositeSign" type = "button" value = " +/- "
onclick = "otherCal('i')" /></td>
<td width = "60" height = "15">
<input name = "percent" type = "button" value = " % "
onclick = "otherCal('p')" /></td>
<td width = "60" height = "15">
<input name = "StoreCurrentNum" type = "button" value = " MS "
onclick = "memeryCal('s')" /></td>
</tr>
<tr>
<td width = "60" height = "15">
<input name = "four" type = "button" value = " 4 "
onclick = "numberPass('4')" /></td>
<td width = "60" height = "15">
<input name = "five" type = "button" value = " 5 "
onclick = "numberPass('5')" /></td>
<td width = "60" height = "15">
<input name = "six" type = "button" value = " 6 "
onclick = "numberPass('6')" /></td>
<td width = "1" height = "15"></td>
<td width = "60" height = "15">
<input name = "AddSign" type = "button" value = " + "
onclick = "operatorPass('+')" /></td>
<td width = "60" height = "15">
<input name = "SubtructSign" type = "button" value = " - "
onclick = "operatorPass('-')" /></td>
<td width = "60" height = "15">
<input name = "ClareStoredNum" type = "button" value = " MC "
onclick = "memeryCal('c')" /></td>
</tr>
<tr>
<td width = "60" height = "15">
<input name = "one" type = "button" value = " 1 "
onclick = "numberPass('1')" /></td>
<td width = "60" height = "15">
<input name = "two" type = "button" value = " 2 "
onclick = "numberPass('2')" /></td>
<td width = "60" height = "15">
<input name = "three" type = "button" value = " 3 "
onclick = "numberPass('3')" /></td>
<td width = "1" height = "15"></td>
<td width = "60" height = "15">
<input name = "MultiplySign" type = "button" value = " * "
onclick = "operatorPass('*')" /></td>
<td width = "60" height = "15">
<input name = "DivisionSing" type = "button" value = " / "
onclick = "operatorPass('/')" /></td>
<td width = "60" height = "15">
<input name = "AddStoredNum" type = "button" value = " M+ "
onclick = "memeryCal('i')" /></td>
</tr>
<tr>
<td width = "60" height = "15">
<input name = "zero" type = "button" value = " 0 "
onclick = "numberPass('0')" /></td>
<td width = "60" height = "15">
<input name = "point" type = "button" value = " . "
onclick = "otherCal('d')" /></td>
<td colspan = "2" height = "15"></td>
<td width = "60" height = "15">
<input name = "CloseWindow" type = "button" value = " back "
onclick = "window.close()" /></td>
<td width = "60" height = "15">
<input name = "equal" type = "button" value = " = "
onclick = "getResult()" /></td>
<td width = "60" height = "15">
<input name = "SubtructStoredNum" type = "button" value = " M- "
onclick = "memeryCal('d')" /></td>
</tr></table></form></td>
<td> </td></tr>
</table>
</body>帮忙看下到底是为什么呀,谢谢了