Answers for "javascript escape quotes"

1

javascript escape quote method

stringToEscape.replace(/"/g, '\\\"')
Posted by: Guest on March-06-2021
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 single quote

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
0

javascript escape quotes

let text = 'I\'m John Smith';
//I'm John Smith
let text2 = "I\"m Smith John";
//I"m Smith John
let text3 = `Es'cape "all" quotes`
//Es'cape "all" quotes
Posted by: Guest on April-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language