html - jQuery appending multiple line string -


i'm trying append string html element. works fine when it's 1 line string, when try break apart stops working.

  <div><h4 >list do:</h4><span id="added"></span></div> 

this doesn't work:

  var addtext = "<ol>                  <li>item1</li>                  <li>item2</li>                  </ol>"                    $("span#added").html(addtext); 

can make work. want add lot of html code, , i'd readable?

try :

var addtext = "<ol>\                  <li>item1</li>\                  <li>item2</li>\                  </ol>"; 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

c# - Convert XDocument to byte array (and byte array to XDocument) -