Write HTML tags in JavaScript

JavaScript Single line comments can be used to make the code more readable.


<!DOCTYPE html>
<html lang="en">
    <title>JS Single-line Comments</title>
<script type="text/javascript">

        // Write on browser
        document.write("Hello World!");
        // Write text an <h2> Heading
        document.write("<h2> Hello World! </h2>");

        document.write("Hello World!");  // Write Comments at end of a Line

        // Execute JS Code that are write in comment line
        //document.write("<h2>This text is h2 Heading</h2>");


Run it...   »

Example Result