Modifying Elements after Page loads
<html>
<head>
<title>Modifying Elements after Page loads</title>
<script type="text/javascript">
function changeDiv() {
var elem1 = document.getElementById("elem1");
elem1.innerHTML = "<h1>Hello World</h1>";
}
</script>
<body onload="changeDiv();">
<div id="elem1">
<p>Paragraph text.</p>
</div>
</body>
</html>
Related examples in the same category