What is JavaScript?

  • JavaScript was first known as Live script, but later it was changed to JavaScript by Netscape.
  • It is a scripting language and is executed on the client side. I.e, it is executed on client browsers.
  • JavaScript is supported on all of the browsers.
  • JavaScript is used mainly used for validation, hover, drag and drop, sliders etc...
  • It is an open source and cross-platform.
  • It contains, a standard library of objects such as array, date, math, operators, control structures and statements etc.

 

syntax:

<script type="text/javascript">
document.write("hello") ;
</script>

Copy

 

Example:

<!DOCTYPE HTML>
<html>
<head>
</head> <body>
<p id="example"></p>
<script type="text/javascript"> // write your script here.
document.getElementById("example").innerHTML= "sai";
</script>
</body>
</html>