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