'createDocumentFragment()' Example : createDocumentFragment « Javascript Methods « JavaScript Reference

'createDocumentFragment()' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
   var newDoc = document.createDocumentFragment();
   newDoc.innerHTML = "<p>some text</p>";
   alert(newDoc.innerHTML); 
} 
</script>
<input id="myT" type="button" value="Click me" onclick="function1();">
</body>
</html>

    
      
      








Related examples in the same category

1.'createDocumentFragment()' Syntax, Parameters and Note
2.'createDocumentFragment()' is applied to