V8 Javascript API

Attributes Class Reference

[Utility]

Description

Attributes associated with an Element

Functions

Object all()
Returns all attributes defined on this element. More...
bool  exists( String name)
Whether an attribute exists on this element or not. More...
varying get( String name)
Returns the value of the named attribute. More...
String get_propagation( String name)
Returns the attribute propagation setting of the named attribute. More...
String get_type( String name)
Returns the type of the named attribute. More...
 remove( String name)
Removes the named attribute from the element. More...
 set( String name, varying value, String type_name)
Sets the value of the named attribute. More...
 set_propagation( String name, String value)
Sets the attribute propagation setting of the named attribute. More...

Functions

Object Attributes.all()

Returns all attributes defined on this element.

Returns

object containing all attributes.

bool Attributes.exists( String name)

Whether an attribute exists on this element or not.

Parameters

name
the name of the attribute

Returns

true if it exists, false otherwise.

varying Attributes.get( String name)

Returns the value of the named attribute.

Parameters

name
the name of the attribute to get.

Returns

the value of the attribute or undefined if it doesn't exist.

String Attributes.get_propagation( String name)

Returns the attribute propagation setting of the named attribute.

Parameters

name
the name of the attribute whose propagation should be returned.

Returns

undefined if the attribute does not exist or one of standard or override .

String Attributes.get_type( String name)

Returns the type of the named attribute.

Parameters

name
the name of the attribute whose type should be returned.

Returns

the typename of the attribute or undefined if the attribute does not exist.

Attributes.remove( String name)

Removes the named attribute from the element.

Parameters

name
the name of the attribute to remove.
Attributes.set( String name, varying value, String type_name)

Sets the value of the named attribute. If value does not match the type of the existing attribute, or if the attribute does not exist and type_name is not supllied this function will throw.

Parameters

name
the name of the attribute to set.
value
the value of the attribute.
type_name
the type name of the attribute. If this is supplied then the attribute will be created if it does not exist.
Attributes.set_propagation( String name, String value)

Sets the attribute propagation setting of the named attribute.

Parameters

name
the name of the attribute whose propagation should be set.
value
the propagation value. Must be one of:
  • 'standard'
  • 'override'