I just saw html5shiv and found this code:
function addStyleSheet(ownerDocument, cssText) { var p = ownerDocument.createElement('p'), parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; p.innerHTML = 'x<style>' + cssText + '</style>'; return parent.insertBefore(p.lastChild, parent.firstChild); }
Where is p.innerHTML = 'x<style>' + cssText + '</style>'; . Why is x used here?
source share