Skip to main content

Java Script

Java Script | HTML: Java Script is the web programming language. It creates the behaviour to the html elements.

Here is the Javascript.html:

  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3.   <head>
  4.     <link rel="stylesheet" href="css/stylesheet.css">
  5.     <title>JavaScript in Html</title>
  6.   </head>
  7.   <body>
  8.     <!-- What is JavaScript, Use of JavaScript, and Where to use JavaScript -->
  9.     <p>Here is the way to use JavaScript</p><br>
  10.     <!-- Internal -->
  11.     <script>
  12.       function oursScript() {
  13.         document.getElementById("script001").innerHTML = "First JavaScript!";
  14.       }
  15.     </script>
  16.     <br>
  17.     <button type="button" onclick="oursScript()">Click</button><br>
  18.     <p id="script001"></p>
  19.     <br>
  20.     <!-- External -->
  21.     <script src="js/javascript.js"></script>
  22.     <br><br>
  23.     <!-- Inline -->
  24.     <button type="button" onclick="window.print()">Check it Out</button>
  25.   </body>
  26. </html>

Web view of Html:



Here is the Video: