Javascript method to achieve difference: 1. Create an HTML sample file; 2. Create an input input box; 3. Calculate the difference of the numbers in the input through the "num1-num2" formula, and then put it in a div. Can.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
How to find the difference in javascript?
JavaScript calculates the difference between two numbers:
Requirements
Enter two numbers in the two input boxes and click When pressing the button, the difference between the two numbers is calculated and displayed in the div with the id of result.
Implementation code
Recommended study: "javascript basic tutorial"
The above is the detailed content of How to find the difference in javascript. For more information, please follow other related articles on the PHP Chinese website!