Set outerHTML (Firefox does not support the outerHTML.) : outerHTML « DOM Node « JavaScript Tutorial






<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>








23.16.outerHTML
23.16.1.Set outerHTML (Firefox does not support the outerHTML.)