0% found this document useful (0 votes)
10 views7 pages

My codes for making a calculator

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

My codes for making a calculator

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

My codes for making a calculator

<html>

<head>

<title> UIBS calculator by soham </title>

</head>

<body>

</body>

<div class="container">

<fieldset id="container">

<form name="calculator">

<input id="display' type="text" name="display" readonly>

<input class="button digits" type="button" value="4"


onclick="calculator.display.value += '4'">
<input class="button digits" type="button" value="5"
onclick="calculator.display.value += '5'">

<input class="button digits" type="button" value="6"


onclick="calculator.display.value += '6'">

<input class="button mathButtons" type="button value="+"


onclick="calculator.display.value += '+'">

<br>

<input class="button digits" type="button" value="7"


onclick="calculator.display.value += '7'">

<input class="button digits" type="button" value="8"


onclick="calculator.display.value += '8'">

<input class="button digits" type="button" value="9"


onclick="calculator.display.value += '9'">

<input class="button mathButtons" type="button value="-"


onclick="calculator.display.value += '-'">

<br>

<input class="button digits" type="button" value="1"


onclick="calculator.display.value += '1'">
<input class="button digits" type="button" value="2"
onclick="calculator.display.value += '2'">

<input class="button digits" type="button" value="3"


onclick="calculator.display.value += '3'">

<input class="button mathButtons" type="button value="x"


onclick="calculator.display.value += '*'">

<br>

<input id=clearButton class="button" type="button" value="C"


onclick="calculator.display.value += ''">

<input class="button digits" type="button" value="0"


onclick="calculator.display.value += '0'">

<input class="button mathButtons" type="button" value="="


onclick="calculator.display.value = eval(calculator.display.value)">

<input class="button mathButtons" type="button" value="/"


onclick="calculator.display.value += '/'">

</form>

</fieldset>

</div>
</html>

CSS
<html>

<head>

<title> UIBS calculator by soham </title>

</head>

<body>

</body>

<div class="container">

<fieldset id="container">

<form name="calculator">
<input id="display' type="text" name="display" readonly>

<input class="button digits" type="button" value="4"


onclick="calculator.display.value += '4'">

<input class="button digits" type="button" value="5"


onclick="calculator.display.value += '5'">

<input class="button digits" type="button" value="6"


onclick="calculator.display.value += '6'">

<input class="button mathButtons" type="button value="+"


onclick="calculator.display.value += '+'">

<br>

<input class="button digits" type="button" value="7"


onclick="calculator.display.value += '7'">

<input class="button digits" type="button" value="8"


onclick="calculator.display.value += '8'">

<input class="button digits" type="button" value="9"


onclick="calculator.display.value += '9'">

<input class="button mathButtons" type="button value="-"


onclick="calculator.display.value += '-'">
<br>

<input class="button digits" type="button" value="1"


onclick="calculator.display.value += '1'">

<input class="button digits" type="button" value="2"


onclick="calculator.display.value += '2'">

<input class="button digits" type="button" value="3"


onclick="calculator.display.value += '3'">

<input class="button mathButtons" type="button value="x"


onclick="calculator.display.value += '*'">

<br>

<input id=clearButton class="button" type="button" value="C"


onclick="calculator.display.value += ''">

<input class="button digits" type="button" value="0"


onclick="calculator.display.value += '0'">

<input class="button mathButtons" type="button" value="="


onclick="calculator.display.value = eval(calculator.display.value)">

<input class="button mathButtons" type="button" value="/"


onclick="calculator.display.value += '/'">
</form>

</fieldset>

</div>

</html>

INCOMPLETE

You might also like