Set outerHTML (Firefox does not support the outerHTML.) : outerHTML : DOM Node JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » DOM Node » outerHTML »

 

Set outerHTML (Firefox does not support the outerHTML.)

















<html>
<head>
<title>OuterHTML Example</title>
<script type="text/javascript">
function useOuterHTML() {
   var oDiv = document.getElementById("div1");
   oDiv.outerHTML = "<P>This is a paragraph</p>";
}
</script>
</head>
<body>
<div id="div1" >This is my original text</div>
<input type="button" value="Use OuterHTML" onclick="useOuterHTML()" />
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo DOM Node
» outerHTML