Home > Web Front-end > JS Tutorial > body text

How to save and operate numeric type variables in the page in JavaScript_javascript skills

WBOY
Release: 2016-05-16 15:51:19
Original
1183 people have browsed it

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.

Copy code The code is as follows:



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

Copy code The code is as follows:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template