Availability
DOM Level 2 CSS
Synopsis
void setProperty(String propertyName,
String value,
String priority)
throws DOMException;
Arguments
propertyName
The name of the CSS attribute to set. value
The new value of the attribute, as a string. priority
The new priority of the attribute. This argument should be
"important" if the attribute specification is
!important; otherwise, it should be the empty
string.
Throws
This method throws a DOMException with a code of
SYNTAX_ERR if the specified
value argument is malformed. It throws a
DOMException with a code of
NO_MODIFICATION_ALLOWED_ERR if the style
declaration or the attribute being set is read-only.
Description
This method adds the named CSS attribute with its value and priority
to this style declaration, or, if the declaration already contains a
value for the named attribute, it simply sets the value and priority
for that existing attribute.
Using setProperty( ) to add a new CSS attribute to
a style declaration may insert the new attribute at any position and
may, in fact, totally shuffle the order of all existing attributes.
Therefore, you should not use setProperty( ) while
you are iterating through the set of attribute names with the
item( ) method.
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.