Javascript in HTML:
Javascript in HTML:
To give the page more attractive and effective we are using JavaScript. It gives more action and makes a webpage Interactive and complete.
How to add JavaScript to the webpage?
You need to define the JavaScript in <script> tag anywhere in the webpage. There are some famous JavaScript actions i.e. form validation, Image alternation, etc.
Example:
<!DOCTYPE html>
<html>
<body>
<h2> JavaScript </h2>
<p id="money"></p>
<script>
document.getElementById("money").innerHTML = "Hello folks!";
</script>
</body>
</html>
Interesting thing about <noscript> tag in html:
Generally, the <noscript> tag in HTML is used where you have disabled the scripts in a web browser or some other issue. To show the error message we write content inside the <noscript> tag.
Example:
<!DOCTYPE html>
<html>
<body>
<p id="money"></p>
<script>
document.getElementById("money").innerHTML = "Hello folks!";
</script>
<noscript>There is some issue your browser does not support JavaScript, please do plug in!</noscript>
</body>
</html>
