0% found this document useful (0 votes)
10 views1 page

Javascript Enter Add and All

The document is an HTML form that allows users to input two numbers for basic arithmetic operations. It includes JavaScript code intended to handle form submission and perform addition, subtraction, multiplication, division, and calculate the remainder. However, the code contains several syntax errors that would prevent it from functioning correctly.

Uploaded by

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

Javascript Enter Add and All

The document is an HTML form that allows users to input two numbers for basic arithmetic operations. It includes JavaScript code intended to handle form submission and perform addition, subtraction, multiplication, division, and calculate the remainder. However, the code contains several syntax errors that would prevent it from functioning correctly.

Uploaded by

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

<!

doctype html>
<html>
<body>
<from>
<label>First number: <input type="number" name="n1" /></label><br />

<label>Second number: <input type="number" name="n2" /></label><br />

<input type="submit" value="Submit" />

<div id="output"></div>

</form>

</body>

<script type="text/javascript">

var form = document querySelector('form');

form.addEventListener 'submit', function (e) {

e preventDefault:

var formData = new FormData form);

var a = pout += "<br><br>Subtraction is: " + res;

resa b

out += "<br><br>Multiplication is: " + res:

resa/b:

out += "<br><br>Division is: " + res

res = a%b

out += "<br><br>Remainder is: + res

document querySelector "#output" innerHTML = outparseInt formData get('n1'));


</script>
</body>
</html>

var b= parseInt formData get 'n2'

var res

var out

res = a + b

out += "<br><br>Addition is:"res

res = a b

You might also like