document.ids.align

JavaScript 1.2+ Nav4+ Syntax

document.ids.idName.align

Description

The align property specifies the alignment of an element within its parent as associated with the ID called idName.

The align property can be assigned one of the following values: left, right, or none.

Note

The align property is referred to as float when using CSS syntax. JavaScript could not use the word "float" because it was a reserved word.

Example

Listing 7.104 uses the align property to align a paragraph to the right of its parent, the document.

Listing 7.104 Aligning Right with the align Property
 <html> <script> <!--Hide //Create a style sheet id that aligns right document.ids.RIGHT.align = "right"; //Hide End ---> </script> <p id=RIGHT>Send ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.