how to assign a block of html code to a javascript variable -
What is the syntax for storing a block of HTML code in a javascript variable?
& lt; Div class = 'saved' & gt; & Lt; Div & gt; Test.test & lt; / Div & gt; & Lt; Div class = 'remove' & gt; [Remove] & lt; / Div & gt; & Lt; / Div & gt; I want to allocate the above code in a variable 'test' var test = " But this is not working, which are the correct syntax for specifying the code?
TIA
var test = "& lt; Div class = 'saved' & gt; + " Test.test & lt; / div & gt; & lt; Div class = 'Remove' & gt; [Remove] & lt; / div & gt; & lt; / div & gt; ; "; If you need line-break then you can add "\ n".
Comments
Post a Comment