_satellite.hasAttr([element], [attribute])

Please readĀ Limitations before using this reference. The object was tested on June 26, 2016. Other _satellite objects are onĀ DTM _satellite Object List.

 

Description

Check if the element has the attribute or not. Return true if the attribute is existed, otherwise false.

Object Type

  • function with parameters

Parameters

  • element: HTML element
  • attribute name: HTML attiribute

Return Value

  • true / false (type = boolean)

JavaScript on Developer Console
The following codes were found when “_satellite.hasAttr” was typed on Developer Console.

 

Examples

Example 1
Check if the <html> element has “class” or “lang” attributes or not.

Example 2
Check if the <a> element has “class” or “tag” attributes or not.

Example 3
Find the “class1” elements. Check if each element has “target” attribute or not.

References

Leave a Reply

Your email address will not be published. Required fields are marked *