javascript escape apostrophe
document.getElementById("something").innerHTML = "<img src='something' onmouseover='change(\"ex1\")' />";
0
2
var string = 'this isn\'t a double quoted string';
var string = "this isn\"t a single quoted string";
// ^ ^ same types, hence we need to escape it with a backslash
Thank you!
2
0
Are there any code examples left?
New code examples in category Javascript