I'm trying to append a string to a HTML element. It works fine when it's a one line string, but when I try to break it apart it stops working.
<div><h4 >List to 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 anyone help to make it work. I want to add a lot of HTML code, and I'd like it to be readable?