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
Post a Comment