JavaScript with HTML Part – 1

Full Stack Web Development Courses with Real-time projects Start Now!!

Program 1

<html>
    <head>
        <title>This is My First Java Script Page</title>
        <script type="text/javascript">
            document.writeln("<font color=red size=5>This is my java script line</font>")  
            document.writeln("<br><font color=red size=5>This is my java script line</font>")  
            document.writeln("<br><font color=red size=5>This is my java script line</font>")  
         </script>
    </head>
    <body>
        <center>
            <h1>Wel Come in Java Script</h1>
         </center>   
         <script type="text/javascript">
            document.writeln("<font color=blue size=5>This is my java script line</font>")  
            document.writeln("<br><font color=blue size=5>This is my java script line</font>")  
            document.writeln("<br><font color=blue size=5>This is my java script line</font>")  
         </script>
    </body>
</html>

Program 2

<html>
    <head>
        <title>This is My Second Java Script Page</title>
        <script type="text/javascript" src="myfile.js">
            
         </script>
    </head>
    <body>
        <center>
            <h1>Wel Come in Java Script</h1>
         </center>   
         
    </body>
</html>

Program 3

document.writeln("This is My external java script file")  
document.writeln("<font color=red size=5>This is my java script line</font>")  
document.writeln("<br><font color=red size=5>This is my java script line</font>")  
document.writeln("<br><font color=red size=5>This is my java script line</font>")  
window.alert("Hello,friends How Are you")

 

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

courses
Image

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *