Prev Demo
JavaScript
>
Division
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <h1>Division</h1> <script type="text/javascript"> function Division() { var a = document.getElementById("txtA").value; var b = document.getElementById("txtB").value; var result = parseInt(a) / parseInt(b); alert(result); } </script> Enter two digit: <input type="text" id="txtA" name="txtA" /> / <input type="text" id="txtB" name="txtA" /> <input type="button" name="btnDivision" value="Submit" onclick="Division()" /> </body> </html>
Note: We DO NOT save your trial code in our database.
Output