HTML JavaScript

HTML JavaScript

HTML JavaScript

HTML JavaScript

HTML JavaScript Date and Time

html
<!DOCTYPE html>
<html>
<head>
    <title>HTML JavaScript</title>
</head>
<body>

<h3>HTML JavaScript Date and Time</h3>

<button type="button"
onclick="document.getElementById('DateTime').innerHTML = Date()">
Click me to display Date and Time</button>

<p id="DateTime"></p>

</body>
</html> 

Inline JavaScript

Inline JavaScript

Adding JavaScript in HTML

html
<!DOCTYPE html>
<html>
<head>
  <title>Inline JavaScript</title>
</head>
<body>

 <h4>Adding JavaScript in HTML</h4>

<button onclick="alert('Button Clicked')">
  Click Here
</button>

</body>
</html> 

Internal JavaScript

Internal JavaScript

Add JavaScript Code inside Head Section

Csias

html
<!DOCTYPE html>
<html>
<head>
<title>Internal JavaScript</title>
<script>
  function myfunction() {
    document.getElementById("InternalJS")
    .innerHTML = "HELLO WORLD";
  }
</script>
</head>
<body>

<h2>Add JavaScript Code inside Head Section</h2>

<h3 id="InternalJS" style="color: blue;">Csias</h3>

<button type="button" onclick="myfunction()">Click Me</button>

</body>
</html>

HTML <noscript> Tag

HTML noscript Tag

HTML noscript Tag

Hello JavaScript

html
<!DOCTYPE html>
<html>
<head>
  <title>HTML noscript Tag</title>
</head>
<body>

<h4>HTML noscript Tag</h4>

<p id="NameId"></p>

<script>document.getElementById("NameId").innerHTML = "Hello JavaScript"</script>

<noscript>Your browser does not support JavaScript!</noscript>

</body>
</html>