asp.net.ph

Skip Navigation Links

setAttribute Method

DHTML Methods


Sets the value of the given attribute.

Syntax

object.setAttribute ( "sName",  vValue, [ iFlags ] ) 
Parameters

sName Required. String specifying the name of the attribute.
vValue Required. String, number, or Boolean value to assign to the attribute.
iFlags Optional. One or more of the following flags may be specified:

0 When the attribute is set, it should overwrite any attributes with the same name, regardless of their case.
1 The case of the attribute should be respected when it is set on the object.


Return Value

No return value.

Remarks

If the attribute is not already present, the method adds the attribute to the object and sets the value. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter.

Be careful when spelling attribute names. If iFlags is set to 1 and sName does not have the same uppercase and lowercase letters as the attribute, a new attribute is created for the object.

See Also

getAttribute



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note