Skip to content

Instantly share code, notes, and snippets.

@edigu
Created May 16, 2013 08:51
Show Gist options
  • Save edigu/5590355 to your computer and use it in GitHub Desktop.
Save edigu/5590355 to your computer and use it in GitHub Desktop.
Amazing legacy bug in Google Chrome!
var elem = document.getElementById('any-element-id');
elem.innerHTML = '<table class="bar">' + "A text ";
elem.innerHTML += "Another textual string";
elem.innerHTML += '</table>';
// Produces : "A text <table class="bar"></table>Another textual string</table>"
// Expected : "<table class="bar">A text Another textual string</table>"
// http://webdesignpatterns.org/pattern/amazing-legacy-bug-google-chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment