Script tag
Advertisements
Script tag
<script> tag are used for define JavaScript functions required for the page. It may be inside the <head> tag or you can use this tag any where on html page.
Syntax
<script> function hello { alert("Hello how r u ?"); } </script>
Example
<!doctype html> <html> <head> <script> function alertmsg() { alert("Alert function call"); } </script> </head> <form> <input type="button" value="Click Me" onclick="alertmsg()"/> </form> </html>
Result
Browser supported
Element | |||||
<script> | Yes | Yes | Yes | Yes | Yes |
Google Advertisment