CSSPrimitiveValue : CSSValue
Return to: HTML DOM Level 2 index

Single value for a CSS style.

Platform Support

IE Mozilla Netscape Opera Safari Chrome
no 1.0+ no 9.0+ 1.0+ no

Constructors

Constructor Action IE Mozilla Netscape Opera Safari Chrome
CSSPrimitiveValue Constructor() : CSSPrimitiveValue
Single value for a CSS style.
Show Details no 1.0+ no 9.0+ 1.0+ no

CSSPrimitiveValue() : CSSPrimitiveValue

Single value for a CSS style.

Returns
CSSPrimitiveValue

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Safari Chrome
primitiveType : Number
Holds the value of a constant. See Remarks for possible values.
Show Details no 1.0+ no 9.0+ 1.0+ no
Remarks

The following list of constants describes the possible values for primitiveType:

  • CSS_UNKNOWN=0 - Unrecognized or unparseable value.
  • CSS_NUMBER=1 - Number with no units.
  • CSS_PERCENTAGE=2- Percentage.
  • CSS_EMS=3 - Relative length in ems.
  • CSS_EXS=4 - Relative length in exs.
  • CSS_PX=5 - Length in pixels.
  • CSS_CM=6 - Absolute length in centimeters.
  • CSS_MM=7 - Absolute length in millimeters.
  • CSS_IN=8 - Absolute length in inches.
  • CSS_PT=9 - Absolute length in points.
  • CSS_PC=10 - Absolute length in picas.
  • CSS_DEG=11 - Angle in degrees.
  • CSS_RAD=12 - Angle in radians.
  • CSS_GRAD=13 - Angle in grads.
  • CSS_MS=14 - Time in milliseconds.
  • CSS_S=15 - Time in seconds.
  • CSS_HZ=16 - Frequency in hertz.
  • CSS_KHZ=17 - Frequency in kilohertz.
  • CSS_DIMENSION=18 - Dimension without units.
  • CSS_STRING=19 - String.
  • CSS_URI=20 - URI.
  • CSS_IDENT=21 - Unique identifier.
  • CSS_ATTR=22 - Attribute function.
  • CSS_COUNTER=23 - Counter.
  • CSS_RECT=24 - Rectangle.
  • CSS_RGBCOLOR=25 - Color (RGB).
Availability

HTML DOM Level 2|W3C

Functions

Method Action IE Mozilla Netscape Opera Safari Chrome
getCounterValue() : Counter
Returns the counter object that represents the value of a CSS counter.
Show Details no 1.0+ no no no no

Returns
Counter

Availability

HTML DOM Level 2|W3C

getFloatValue(Number unitType) : Number
The value of a number, converted to the appropriate units, if applicable.
Show Details no 1.0+ no no no no

Parameters
Number unitType Units to convert the value to.

Returns
Number

Availability

HTML DOM Level 2|W3C

getRectValue() : Rect
Returns a Rect object representing the value of a CSS_RECT.
Show Details no 1.0+ no no no no

Returns
Rect

Availability

HTML DOM Level 2|W3C

getRGBColorValue() : RGBColor
Returns a RGBColor object representing the value of a CSS_RGBCOLOR.
Show Details no 1.0+ no no no no

Returns
RGBColor

Availability

HTML DOM Level 2|W3C

getStringValue() : String
Returns the value of a string.
Show Details no 1.0+ no no no no

Returns
String

Availability

HTML DOM Level 2|W3C

setFloatValue(Number unitType, Number floatValue) : void
Sets the value of a number to the specified value for the specified units.
Show Details no 1.0+ no no no no

Parameters
Number unitType Units to set the number to.
Number floatValue Value of the number.

Returns
void

Availability

HTML DOM Level 2|W3C

setStringValue(Number stringType, String stringValue) : void
Sets a string to the specified value and type.
Show Details no 1.0+ no no no no

Parameters
Number stringType Type to set the string to.
String stringValue Value of the string.

Returns
void

Availability

HTML DOM Level 2|W3C

References

Counter|CSSValue|CSSValueList|Rect|RGBColor

Availability

HTML DOM Level 2|W3C

text_javascript aptana_docs