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.
2024-01-10, 1401🔥, 0💬
Popular Posts:
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a...
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
What properties and functions are supported on http.client.HTTPResponse objects? If you get an http....