setStringValue method (CSSPrimitiveValue)
Specifies a string value for the CSSPrimitiveValue object with the specified type.
If the style property that belongs to the CSSPrimitiveValue object cannot accept the new value, the setStringValue method raises an exception. A CSSPrimitiveValue object can only be retrieved with the getPropertyCSSValue method.
You can find the related objects in the Supported by objects section below.
Required. Integer that specifies the type of the string.
Predefined constants are available for the possible values of this parameter, in the scope of the CSSPrimitiveValue object. For further details, see the page for the CSSPrimitiveValue object.
One of the following values (the value of a predefined constant appears in parentheses after the constant):
|Required. String that specifies the value of the string.|
This method has no return value.
Example HTML code 1:
This example illustrates the use of the setStringValue method:
Did you find this example helpful?
User Contributed Comments