'createElement()' Example
<html>
<body>
<script language="javascript">
function function1(){
var myElement = document.createElement('<hr>');
myBody.appendChild(myElement);
}
</script>
<body id="myBody">
<button onClick="function1();">Put horizontal rule</button>
</body>
</html>
Related examples in the same category