what is the syntax to store a block of html code to a javascript variable?
<div class='saved' > <div >test.test</div> <div class='remove'>[Remove]</div></div>
I want to assign the above code to a variable 'test'
var test = "<div class='saved' > <div >test.test</div> <div class='remove'>[Remove]</div></div>";
but it does not work, which are the correct syntax for assigning the code?
TIA
var test = "<div class='saved' >"+ "<div >test.test</div> <div class='remove'>[Remove]</div></div>";
You can add " " if you require line-break.
1.4m articles
1.4m replys
5 comments
57.0k users