Tools, FAQ, Tutorials:
HTML 'script' Tag/Element in 'head' Element
What Is an HTML "script" Tag/Element?
✍: FYIcenter.com
A "script" element is an optional sub-element of the "head" and many
other HTML elements. If a "script" element is placed inside
the "head" element, the specified script code will not be executed immediately.
Usually, you use "script" elements in the "head" element to define script functions. and use other "script" elements in the "body" element to call those functions. Here is good example of a script element:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>My First Script Document</title> <script type="text/javascript"> function hello() { alert("Hello world!?"); } </script> </head> <body> <p><script type="text/javascript"> hello(); </script></p> </body> </html>
If you save the above document as hello.html, and view it with Internet Explorer, you will see a small dialog box showing up.
Â
⇒HTML Document Structure and Head Level Tags
⇒⇒HTML Tutorials
2017-02-20, 907👍, 0💬
Popular Posts:
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How Values in Arrays Are Indexed in PHP? Values in an array are all indexed their corresponding keys...