JS Tostring добавляет Backslash

var x = "<div class=\\\"abcdef\\\">";
x = x.replace(/\\"/g, '"');
document.body.appendChild(
  document.createTextNode("After: " + x)
);
Anxious Alpaca