Addition Assignment operator (+ =). Adds a variable value to an expression value, and assigns it to the variable.
In writing javascrpt often use, to tell the truth I did not quite understand before. Read a lot of code feeling is because a variable is too long to use it to separate lines to write it. But it's and solves my other problems.
At some point we need to use a series of HTML code as a variable, and there are always quotes in the HTML. Like what
Copy Code code as follows:
var nameform= ' <div id= "pointname" ><input id= "Pointnametext" type= "text" size=18 value= "Enter your landmark name" class= "here Inputfield "onfocus=" This.value=null "onblur=" this.value= ' Please enter the landmark name '/></div> ' here;
At this point you will find that the question of quotes always bothers you. This time with ' + = ' to solve the problem.
Copy Code code as follows:
var nameform= ' <div id= ' Pointname "><input id=" Pointnametext " type=" text " size=18 value=" Please enter the landmark name " class=" Inputfield " onfocus=" here This.value=null " onblur=" this.value= ';
nameform+= ' ";
Nameform+= ' Please enter the landmark name ';
nameform+= ' ';
nameform+= '/></div> ';