Javascript Demo

 avatar
unknown
plain_text
a year ago
1.1 kB
7
Indexable
<!DOCTYPE html>
<html>
<!-- This is a html comment-->

<head>

    <script>
        console.log("Hello");

       // alert("Hello World");


        document.write("<b>Hello World</b>");
        var i = 5;

        const pi = 3.14;

        //alert(pi);

        /* pi = 3.15;
     
         alert(i);
         */
        alert("Hello " + pi);



        function add(i,j){
           // alert("Test Function");
        
        return (i+j);

//alert(i+j);
        }

    
        document.write(add(5,6));

        const person = {
            firstName : "John",
            lastname : "Doe"
        }



//document.getElementById("demo").innerHTML = "Test"// person.firstName();

</script>    

    </script>
    </head> <body>

        <p id="para1">Paragraph1</p>
    
       
    
    <p id="demo"></p>

    </body>
    <script>

document.getElementById("demo").innerHTML = person.firstName;
          //  alert(document.getElementById("para1").innerHTML);
</script>



</body>



</html>
Editor is loading...
Leave a Comment