Javascript examples for Operator:Arithmetic Operator
Number Subtraction
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww . jav a2s . com*/ var y = 5; var x = y - 2; document.getElementById("demo").innerHTML = x; } </script> </body> </html>