You are on page 1of 2

1.

Calculator
<html> <form name="calculator"> <table border=4> <tr > <td colspan="7"> <input type="text" name="text" size="45"> <br> </td> </tr> <tr> <td><input type="button" value="1" onClick="calculator.text.value += '1'"></td> <td><input type="button" value="2" onClick="calculator.text.value += '2'"></td> <td><input type="button" value="3" onClick="calculator.text.value += '3'"></td> <td><input type="button" value="+" onClick="calculator.text.value += ' + '"></td> <td><input type="button" value="sqrt" onClick="calculator.text.value += ' Math.sqrt '"></td> <td><input type="button" value="log" onClick="calculator.text.value += ' Math.log '"></td> <td><input type="button" value="." onClick="calculator.text.value += '.'"></td> </tr> <tr> <td><input type="button" value="4" onClick="calculator.text.value += '4'"></td> <td><input type="button" value="5" onClick="calculator.text.value += '5'"></td> <td><input type="button" value="6" onClick="calculator.text.value += '6'"></td> <td><input type="button" value="-" onClick="calculator.text.value += ' - '"></td> <td><input type="button" value="+" onClick="calculator.text.value += ' + '"></td> <td><input type="button" value="sin" onClick="calculator.text.value += 'Math.sin'"></td> <td><input type="button" value="(" onClick="calculator.text.value += '('"></td> </tr> <tr> <td><input type="button" value="7" onClick="calculator.text.value += '7'"></td> <td><input type="button" value="8" onClick="calculator.text.value += '8'"></td> <td><input type="button" value="9" onClick="calculator.text.value += '9'"></td> <td><input type="button" value="*" onClick="calculator.text.value += ' * '"></td> <td><input type="button" value="+" onClick="calculator.text.value += ' + '"></td> <td><input type="button" value="cos" onClick="calculator.text.value += 'Math.cos'"></td> <td><input type="button" value=")" onClick="calculator.text.value += ')'"></td> </tr> <td><input type="button" value="c" onClick="calculator.text.value = ''"></td> <td><input type="button" value="0" onClick="calculator.text.value += '0'"></td> <td><input type="button" value="=" onClick="calculator.text.value = eval(calculator.text.value)"></td> <td><input type="button" value="/" onClick="calculator.text.value += ' / '"></td> <td><input type="button" value="+" onClick="calculator.text.value += ' + '"></td> <td><input type="button" value="tan" onClick="calculator.text.value += 'Math.tan'"></td> <td><input type="button" value="PI" onClick="calculator.text.value += 'Math.PI'"></td>

</tr> Ashish Kumar Verma Roll no.: 22 Page 1

</table> </form> </html>

2. Clock
<html> <head> <style> h1{font-size:250px;} </style> <center><script type="text/javascript"> var dt=new Date(); document.write("<h1>"+dt.getHours()); document.write(":"+dt.getMinutes()); document.write(":"+dt.getSeconds()+"</h1>"); </script></center> </head> <body> <meta http-equiv="refresh" content="1"> </body> </html>

Ashish Kumar Verma Roll no.: 22

Page 2

You might also like