getElements

Gets an array of elements in the active tab, satisfying the specified conditions

Syntax

getElements = function(aTagName, aAttributes, aValues, aStrong,
  aAntiAttributes, aAntiValues, aAntiStrong);

Parameters

  • aTagName
    • functions: elements tag
  • aAttributes
    • functions: array of elements attributes
  • aValues
    • functions:array of attribute values ​​corresponding to the array of elements attributes
  • aStrong
    • functions: flag of match precision of the attribute values
  • aAntiAttributes
    • functions:array of exclusive attributes
  • aAntiValues
    • functions: array of values of exclusive attributes
  • aAntiStrong
    • functions: flag of match precision of the exclusive attribute values

Returned value

  • functions: structure containing parameters of the found elements array

Notes

  • When searching for elements script enumerates all the elements that have values ​​aValues of aAttributes ​​attributes . Of these elements, the script selects the elements that are not have value aAntiValues ​​of aAntiAttributes attributes. If aStrong flag is true, the elements are found, the values ​​ aValues ​​of aAttributes properties of which are strictly equal to the specified (sensitive search is not considered). Otherwise, elements will be found in aAttributes property values of ​​which include the appropriate values ​​aValues. Similarly, with the flag aAntiStrong.
  • If no elements are found, the fields of the resultant structure will be empty.
  • Found elements will be highlighted by a dotted frame

Examples

  1. //Loading page http://www.thetimes.co.uk/
    loadURI('http://www.thetimes.co.uk/');
    //Get all elements with tag "a" (all links)
    var elements = getElements('a');