Home > Article > Web Front-end > How to save and operate numeric type variables in the page in JavaScript_javascript skills
Previously, I embedded the following javascript fragment in the html page, but when a button is clicked, the i value will be increased by one, but after two clicks, the initial value of i has not changed.
Later, the variable was declared in a test object, as shown in the following code. In this way, every time test.i is changed, the value of test.i can be saved