Answers for "javascript escape apostrophe"

2

javascript escape single quote

document.getElementById("something").innerHTML = "<img src='something' onmouseover='change(\"ex1\")' />";
Posted by: Guest on July-09-2020
1

javascript escape apostrophe

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
Posted by: Guest on July-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language