HTML CSS Reference/HTML Tag Reference/script

Материал из Web эксперт
Перейти к: навигация, поиск

"script" CSS Attributes and JavaScript Style Properties

Names noted with an asterisk (*) are JavaScript properties only.
+----------------+--------------------------------------------------------------+
| CSS            |background-position-x           background-position-y         |
| Attributes     |behavior                        layout-grid                   |
| and            |layout-grid-mode                pixelBottom(*)                |
| JavaScript     |pixelHeight(*)                  pixelLeft(*)                  |
| Style          |pixelRight(*)                   pixelTop(*)                   |
| Properties     |pixelWidth(*)                   posBottom(*)                  |
|                |posHeight(*)                    posLeft(*)                    |
|                |posRight(*)                     posTop(*)                     |
|                |posWidth(*)                     text-autospace                |
|                |text-underline-position                                       |
+----------------+--------------------------------------------------------------+



"script" Event Handlers

+----------------+--------------------------------------------------------------+
| Event          |onLoad                          onPropertyChange              |
| Handlers       |onReadyStateChange                                            |
+----------------+--------------------------------------------------------------+



"script" Example

    
<html>
<head>
<title>script element example</title>
    <script language="javascript" src="yourlinkedjavascriptfile.js">
    </script>
    <script id="script1" language="javascript">
    <!--script code//-->
    </script>
</head>
<body>
    <script id="script2" language="javascript">
    <!--script code //-->
    </script>
</body>
</html>



"script" HTML Attributes

+----------------+--------------------------------------------------------------+
| HTML           |charset                         defer                         |
| Attributes     |event                           for                           |
|                |id                              lang                          |
|                |language                        src                           |
|                |type                                                          |
+----------------+--------------------------------------------------------------+



"script" JavaScript Collections

+----------------+--------------------------------------------------------------+
| JavaScript     |all                             attributes                    |
| Collections    |behaviorUrns                    childNodes                    |
|                |children                                                      |
+----------------+--------------------------------------------------------------+



"script" JavaScript Methods

+----------------+--------------------------------------------------------------+
| JavaScript     |addBehavior                     appendChild                   |
| Methods        |applyElement                    attachEvent                   |
|                |clearAttributes                 cloneNode                     |
|                |componentFromPoint              contains                      |
|                |detachEvent                     dragDrop                      |
|                |fireEvent                       getAdjacentText               |
|                |getAttribute                    getAttributeNode              |
|                |getElementsByTagName            hasChildNodes                 |
|                |insertAdjacentElement           insertBefore                  |
|                |mergeAttributes                 normalize                     |
|                |removeAttribute                 removeAttributeNode           |
|                |removeBehavior                  removeChild                   |
|                |replaceAdjacentText             replaceChild                  |
|                |setAttribute                    setAttributeNode              |
|                |swapNode                                                      |
+----------------+--------------------------------------------------------------+



"script" JavaScript Properties

+----------------+--------------------------------------------------------------+
| JavaScript     |canHaveHTML                     charset                       |
| Properties     |className                       clientHeight                  |
|                |clientLeft                      clientTop                     |
|                |clientWidth                     defer                         |
|                |dir                             disabled                      |
|                |event                           firstChild                    |
|                |htmlFor                         id                            |
|                |innerHTML                       innerText                     |
|                |isContentEditable               isDisabled                    |
|                |isMultiLine                     isTextEdit                    |
|                |lang                            language                      |
|                |lastChild                       nextSibling                   |
|                |nodeName                        nodeType                      |
|                |nodeValue                       offsetHeight                  |
|                |offsetLeft                      offsetParent                  |
|                |offsetTop                       offsetWidth                   |
|                |ownerDocument                   parentElement                 |
|                |parentNode                      parentTextEdit                |
|                |previousSibling                 readyState                    |
|                |scopeName                       scrollHeight                  |
|                |scrollLeft                      scrollTop                     |
|                |scrollWidth                     sourceIndex                   |
|                |src                             tagName                       |
|                |tagUrn                          text                          |
|                |title                           type                          |
|                |uniqueID                                                      |
+----------------+--------------------------------------------------------------+



"script" Microsoft Behaviors

+----------------+--------------------------------------------------------------+
| Microsoft      |clientCaps                      download                      |
| Behaviors      |homePage                        saveSnapshot                  |
+----------------+--------------------------------------------------------------+



"script" Syntax and Note

Note:
This element contains the scripts.
It can stay in either the <head> or the <body> section.
    
Syntax:
    
<script attributes events> . . . </script>