<html>
<body>
<h1>outerHTML</h1>
<p>Click the button to change the header from a h1 to a h3.</p>
<button onclick="myFunction()">Change Header</button>
<script>
function myFunction() {
var x = document.getElementsByTagName("h1")[0];
x.outerHTML = "<h3>You changed the entire header element and it's content!</h3>";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_outerhtml by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:20 GMT -->
</html>