Im using HTML inside .js file and it shows error when the HTML has new line like this
$(".message").click(function() {
document.getElementById("timeline").innerHTML = ' <div>
<p>Hello John</p>
<ul>
<li>Point A</li>
<li>Point B</li>
<li>Point C</li>
<li>Point D</li>
</ul>
</div>';
});
the above code will show error and will not work. but if i used the same code this way:
$(".message").click(function() {
document.getElementById("timeline").innerHTML = '<div><p>Hello John</p><ul><li>Point A</li><li>Point B</li><li>Point C</li><li>Point D</li></ul></div>';
});
is there any way to make the first code work in js file ?
thanks in advance.