javascript create node from innerhtml
function createElement( str ) {
var frag = document.createDocumentFragment();
var elem = document.createElement('div');
elem.innerHTML = str;
while (elem.childNodes[0]) {
frag.appendChild(elem.childNodes[0]);
}
return frag;
}
Also in HTML:
- html
- reset image tag js
- sample text
- javascript create node from innerhtml
- svg circle
- html interview questions
- redirect html
- comment a div in html
- onclick a tag
- why is my option not bold in html
- html2pdf pagebreak option
- my html file shows code in browser
- input html
- javascript upload file without input
- html select multiple
- html sticky touch hover
- html ecrire en gras
- html add vertical space below
- what is b tag in html
- Html.ActionLink with parameters
- add a caption of picture html
- markdown to html
- angular property binding
- javascript onclick alert are you sure