JavaScript Tutorial/DOM Node/outerHTML
Версия от 18:52, 25 мая 2010; (обсуждение)
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>