JS create & TextNode


html file

<!DOCTYPE html>
<html>
<head>
    <title>DOM Navigation</title>
    <style>
        h1{
            text-align: center;
            color:#ff0000;
        }
    </style>
</head>
<body>
    <h1>Yahoo Baba : DOM Create Methods</h1>
    
    <script src="js/dom-create.js"></script>
</body>
</html>


dom-create.js

//var newElement = document.createElement("p");

var newElement = document.createElement("h2");

console.log(newElement);

var newText = document.createTextNode("This is just text");

console.log(newText);

/* Dom Create  Comment*/

var newComment = document.createComment("this is comment");

console.log(newComment);