getElementsAttribute

Gets an array of values ​​of the specified attribute of specified elements

Syntax

getElementsAttribute = function(aElements, aAttribute)

Parameters

  • aElements
    • functions: elements array
  • aAttribute
    • functions: attribute, values of which are to be obtained

Returned value

  • functions: array of attribute values

Notes

Examples

  1. //Loading page google.ru
    loadURI('google.ru');
    //Get an elements array "div"
    var elements = getElements('div');
    //Get an array of attribute "id" values of elements array.
    var ids = getElementsAttribute(elements,'id');
    log(JSON.stringify(ids));