Home >Web Front-end >JS Tutorial >Application of '=' in JavaScript_javascript skills

Application of '=' in JavaScript_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:19:502321browse

Additive assignment operator (=). Adds the variable value to the expression value and assigns the sum to the variable.
It is often used when writing JavaScript. To be honest, I didn’t understand it very well before. After reading a lot of code, I feel that it is just because a variable is too long that it needs to be written in several lines. But it solved my other problems.
Sometimes we need to use a series of HTML codes as variables, and HTML sometimes contains some quotation marks. For example,

Copy code The code is as follows:

var Nameform='
';

At this time you will find that the problem of quotation marks has always troubled you. At this time, using '=' will solve the problem.
Copy code The code is as follows:

var Nameform='
Nameform ='Please enter the placemark name here';
Nameform ="'";
Nameform ='"/>
';
Statement:
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