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