document.ids.fontStyle
JavaScript 1.2+ Nav4+ Syntax
document.ids.idName.fontStyle
Description
The fontStyle property specifies the font style used by an element when associated with the ID called idName.
The fontStyle property can be assigned one of the following values: normal or italic.
Example
Listing 7.119 uses fontStyle property to italicize the header text.
Listing 7.119 Set the fontStyle Property
<html> <script> <!-- Hide //Create a style sheet id that defines a font style document.ids.I.fontStyle = "italic"; //Hide End ---> </script> <h2 id=I>Italicized Heading</h2> </html> |
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.