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

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -