How to Write JavaScript Code

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

Program 1

<html>
<head><title>My Java script code</title>
<script>
        function display()
      {
            alert("Hello Friends How are You")
            document.write("<center>")
                      a=100
                      b=50
                      c=a+b
             document.write("Addition is: "+c) 
            alert("Addition is: "+c)
            document.write("</center>")
       }

</script>
</head> 
<body>
<center>
<marquee bgcolor=yellow  onmouseover=stop(); onmouseout=start(); >This is my java script file welcome friends</marquee>
    <h1>Wel come in java script </h1>
  
     <form>

        <input type=button value="Click Here" onclick=display()>
         
     </form>
</center>
</body>
</html>

 

Did you like our efforts? If Yes, please give DataFlair 5 Stars on Google

courses

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 *