Flylib.com

Books Software

 
 
 

XHTML Scripts


XHTML Scripts

Scripts make it possible to process data and perform other dynamic events. Scripts are included in web pages thanks to the <script> element, which also identifies the specific scripting language being used (JavaScript, VBScript, and so on.).

<noscript> </noscript>

Usage

Provides alternative content for browsers unable to execute a script.

Start/End Tag

Required/Required.

Attributes

core , i18n , events .

Empty

No.


<script> </script>

Usage

The < script> element contains client-side scripts that are executed by the browser.

Start/End Tag

Required/Required.

Attributes

type=" scripttype " Script language Internet content type.

src=" scripturl " The URL for the external script.

defer=" defer " Indicates that the script doesn't alter document content.

Empty

No.

Notes

You can set the default scripting language in the <meta /> element.




XHTML Common Attributes and Events

The following six attributes are abbreviated as core in the preceding sections:

  • id=" id " A global identifier.

  • class=" styleclasses " A list of classes separated by spaces.

  • style=" styles " Style information.

  • title=" title " Provides more information for a specific element, as opposed to the <title> element, which titles the entire Web page.

  • accesskey=" shortcut " Sets the keyboard shortcut used to access an element.

  • tabindex=" taborder " Sets the tab order of an element.

The following two attributes for internationalization are abbreviated as i18n in the preceding sections:

  • lang=" lang " The language identifier.

  • dir=" texTDir " The text direction ( ltr , rtl ).

The following intrinsic events are abbreviated events :

  • onclick=" eventcode " A pointing device (such as a mouse) was single-clicked.

  • ondblclick =" eventcode " A pointing device (such as a mouse) was double-clicked.

  • onmousedown=" eventcode " A mouse button was clicked and held down.

  • onmouseup=" eventcode " A mouse button that was clicked and held down was released.

  • onmouseover =" eventcode " A mouse moved the cursor over an object.

  • onmousemove=" eventcode " The mouse was moved.

  • onmouseout =" eventcode " A mouse moved the cursor off an object.

  • onkeypress=" eventcode " A key was pressed and released.

  • onkeydown=" eventcode " A key was pressed and held down.

  • onkeyup=" eventcode " A key that was pressed has been released.



CSS Dimension Style Properties

Quite a few CSS style rules rely on dimensional properties in one form or another. It would be difficult to size elements with them.

height

Usage

Sets the height of an element.

Values

auto , length , % .


line-height

Usage

Sets the distance between lines of elements.

Values

normal , length , % .


max-height

Usage

Sets the maximum height of an element.

Values

none , length , % .


max-width

Usage

Sets the maximum width of an element.

Values

none , length , % .


min-height

Usage

Sets the minimum height of an element.

Values

length , % .


min-width

Usage

Sets the minimum width of an element.

Values

length , % .


width

Usage

Sets the width of an element.

Values

auto , length , % .