syntax to make a calculator in html
Answers
Answered by
1
<html>
<body>
<CENTER>
<FORM NAME=”Calc”>
<TABLE BORDER=4>
<TR>
<TD>
<INPUT TYPE=”text” NAME=”Input” Size=”16″>
<br>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE=”button” NAME=”one” VALUE=” 1 ” OnClick=”Calc.Input.value += ‘1’”>
<INPUT TYPE=”button” NAME=”two” VALUE=” 2 ” OnCLick=”Calc.Input.value += ‘2’”>
<INPUT TYPE=”button” NAME=”three” VALUE=” 3 ” OnClick=”Calc.Input.value += ‘3’”>
<INPUT TYPE=”button” NAME=”plus” VALUE=” + ” OnClick=”Calc.Input.value += ‘ + ‘”>
<br>
<INPUT TYPE=”button” NAME=”four” VALUE=” 4 ” OnClick=”Calc.Input.value += ‘4’”>
<INPUT TYPE=”button” NAME=”five” VALUE=” 5 ” OnCLick=”Calc.Input.value += ‘5’”>
<INPUT TYPE=”button” NAME=”six” VALUE=” 6 ” OnClick=”Calc.Input.value += ‘6’”>
<INPUT TYPE=”button” NAME=”minus” VALUE=” – ” OnClick=”Calc.Input.value += ‘ – ‘”>
<br>
<INPUT TYPE=”button” NAME=”seven” VALUE=” 7 ” OnClick=”Calc.Input.value += ‘7’”>
<INPUT TYPE=”button” NAME=”eight” VALUE=” 8 ” OnCLick=”Calc.Input.value += ‘8’”>
<INPUT TYPE=”button” NAME=”nine” VALUE=” 9 ” OnClick=”Calc.Input.value += ‘9’”>
<INPUT TYPE=”button” NAME=”times” VALUE=” x ” OnClick=”Calc.Input.value += ‘ * ‘”>
<br>
<INPUT TYPE=”button” NAME=”clear” VALUE=” c ” OnClick=”Calc.Input.value = ””>
<INPUT TYPE=”button” NAME=”zero” VALUE=” 0 ” OnClick=”Calc.Input.value += ‘0’”>
<INPUT TYPE=”button” NAME=”DoIt” VALUE=” = ” OnClick=”Calc.Input.value = eval(Calc.Input.value)”>
<INPUT TYPE=”button” NAME=”div” VALUE=” / ” OnClick=”Calc.Input.value += ‘ / ‘”>
<br>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</body>
</html>
hope this will help you
mark as brainliest if u like the answer.
Answered by
0
HEY MATE HERE IS YOUR ANSWER
___
<html> <head> <title>HTML Calculator</title> </head> <body bgcolor= "#000000" text= "gold"> <form name="calculator" > <input type="button" value="1" onClick="document.calculator.ans.value+='1'"> <input type="button" value="2" onClick="document.calculator.ans.value+='2'"> <input type="button" value="3" onClick="document.calculator.ans.value+='3'"> <input type="button" value="4" onClick="document.calculator.ans.value+='4'"> <input type="button" value="5" onClick="document.calculator.ans.value+='5'"> <input type="button" value="6" onClick="document.calculator.ans.value+='6'"> <input type="button" value="7" onClick="document.calculator.ans.value+='7'"> <input type="button" value="8" onClick="document.calculator.ans.value+='8'"> <input type="button" value="9" onClick="document.calculator.ans.value+='9'"> <input type="button" value="-" onClick="document.calculator.ans.value+='-'"> <input type="button" value="+" onClick="document.calculator.ans.value+='+'"> <input type="button" value="*" onClick="document.calculator.ans.value+='*'"> <input type="button" value="/" onClick="document.calculator.ans.value+='/'"> <input type="button" value="0" onClick="document.calculator.ans.value+='0'"> <input type="reset" value="Reset"> <input type="button" value="=" onClick="document.calculator.ans.value=eval(document.calculator.ans.value)"> <br>Solution is <input type="textfield" name="ans" value=""> </form> </body> </html>
__
Hope it will help you
@thanksforquestion
@bebrainly
___
<html> <head> <title>HTML Calculator</title> </head> <body bgcolor= "#000000" text= "gold"> <form name="calculator" > <input type="button" value="1" onClick="document.calculator.ans.value+='1'"> <input type="button" value="2" onClick="document.calculator.ans.value+='2'"> <input type="button" value="3" onClick="document.calculator.ans.value+='3'"> <input type="button" value="4" onClick="document.calculator.ans.value+='4'"> <input type="button" value="5" onClick="document.calculator.ans.value+='5'"> <input type="button" value="6" onClick="document.calculator.ans.value+='6'"> <input type="button" value="7" onClick="document.calculator.ans.value+='7'"> <input type="button" value="8" onClick="document.calculator.ans.value+='8'"> <input type="button" value="9" onClick="document.calculator.ans.value+='9'"> <input type="button" value="-" onClick="document.calculator.ans.value+='-'"> <input type="button" value="+" onClick="document.calculator.ans.value+='+'"> <input type="button" value="*" onClick="document.calculator.ans.value+='*'"> <input type="button" value="/" onClick="document.calculator.ans.value+='/'"> <input type="button" value="0" onClick="document.calculator.ans.value+='0'"> <input type="reset" value="Reset"> <input type="button" value="=" onClick="document.calculator.ans.value=eval(document.calculator.ans.value)"> <br>Solution is <input type="textfield" name="ans" value=""> </form> </body> </html>
__
Hope it will help you
@thanksforquestion
@bebrainly
Similar questions