JavaScript DOM create methods

 <!DOCTYPE html>

<html>

    <head>

        <title>DOM create methods</title>

    </head>

    <body>

    <h1>DOM create methods</h1>

        <script>

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

            console.log(newElement );

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

            console.log(newText);

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

            console.log(newComment);

        </script>

    </body>

</html>



OUTPUT




Comments