O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

tags — NN 4 IE n/a DOM n/a

Synopsis

The tags object is used by JavaScript syntax for style sheets. As a property of the document object, this tags object is used in building references to particular HTML elements to get or set their style-related properties. The direct properties of the tags object are all HTML element types. For example:

[document.]tags.P
[document.]tags.H1

There is no need to repeat a list of all HTML elements as properties for this object. These references are usable inside STYLE elements whose TYPE is set to text/javascript. That’s where you assign values to style sheet properties with JavaScript syntax, as in the following examples:

tags.P.color = "green"
tags.H1.fontSize = "14pt"

The properties in the following list are not properties of the tags object per se, but rather of the style sheet associated with an element, class, or ID singled out by a JavaScript syntax assignment statement. The properties are listed here for convenience. Properties dedicated to element positioning are listed separately from regular style properties. A cross reference between these JavaScript properties and their CSS attribute counterparts can be found in Chapter 3 (and Chapter 4 for positioning properties). For information about these property values, consult the CSS reference chapter, where you can find details of all style sheet properties listed by CSS syntax.

Style Properties

backgroundColor

borderWidths( )

marginBottom

paddings

backgroundImage

color

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required