The HTML <script> Tag
The <script> tag is used to define a client-side script, such as a JavaScript.The <script> element either contains scripting statements or it points to an external script file through the src attribute.
Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
Example
<script>
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
React to events:
<button type="button" onclick="myFunction()">Click Me!</button>
Manipulate HTML styles:
document.getElementById("demo").style.color="#ff0000";
No comments:
Post a Comment