$scn(ELEMENT as element/string/array of ELEMENTs, CLASSNAME as string)


ELEMENTDOM ElementstringDOM Element Array

The element(s) to assign the class. Can be a single DOM element, an element ID specified as a string, or an array of DOM Element objects. If specifying the ID as a string, the ID corresponds to the value for the id HTML attribute for the element you wish to assign a style.


The class to assign to the element(s). Any existing classes for the element(s) will be overwritten with the specified class.


The $scn() function sets the class name of the passed-in element(s). This will overwrite any class names the already being using by the element(s). Contrast this with the $acn() function which adds the class name to the element.


/*Set the class name of the 'firstname' element.*/
/*Set the class name of multiple elements. Any existing class names for the elements will be removed.*/
An element can have more than one class name.
Use {dialog.object}.getPointer() to get the DOM element for a control.

See Also