setElementsAttribute

Sets the specified attribute of the specified elements to the specified value.

Syntax

setElementsAttribute = function(aElements, aAttribute, aValue);

Parameters

  • aElements
    • functions: array of elements
  • aAttribute
    • functions: attribute which values have to be set
  • aValue
    • functions: attribute value

Examples

  1. //Loading page google.ru
    loadURI('google.ru');
    //Get elements
    var elements = getElement('input');
    //Set the value of the attribute "class" of all elements equal to "MyClass"
    setElementsAttribute(elements,'class','MyClass');