Site icon DataFlair

Variables in JavaScript

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

Program 1

<html><head><title>Test Java Script variables</title>
  <script lang="javascript">
    var a,b;
    a=60;
    b=20
    c=a+b
     document.write("<font color=red size=10>")
     alert(c)
     document.write("<br>")
     document.write(b)
     document.write("<font>")

  </script>
</head>
<body>
<h1>Test variable Code</h1>
</body>
</html>

 

Exit mobile version