Ticker

6/recent/ticker-posts

JS - Content change(for beginners)

 

 Practical 2

Open text Document or any text editor and type like below. 
 
HTML and JS(javaScript)
<html>
    <head>
        <title>Practical 2</title>
    </head>
    <body>
        <h1 id="change">Before changing</h1>
        <button onclick="practical2()">Change above</button>
        <script>
        function practical2(){
                document.getElementById('change').innerHTML="After changing";
        }
        </script>
    </body>
</html>


Then go to the "File" tab and "Save as". After that "File name: p2.html" and "Save as type: All files (*.*)". Then after that Click on the save button.

The output of this practical 2





To Visit or Download the source code                                        See the results online


Go to Practical 3

Post a Comment

0 Comments