Bridge Elements
The BridgeElement
class lets you easily use bridge-specific data and behaviors on elements in your components. You can wrap any element in a new BridgeElement(myElement)
within your bridge components to access the following:
title
: Returns the title of the element, attempting to use adata-bridge-title
value first, thearia-label
value second, then otherwise falling back to the element’stextContent
orvalue
.disabled
: Returns whether the element is disabled with thedata-bridge-disabled
attribute.enabled
: Returns the opposite ofdisabled
.enableForComponent(component)
: Removes thedata-bridge-disabled
attribute on the element.hasClass(className)
: Returns whether the element has a particular class in itsclassList
.attribute(name)
: Returns the value of an attribute on the element.bridgeAttribute(name)
: Returns the value of adata-bridge-<name>
attribute on the element.setBridgeAttribute(name, value)
: Sets the value of adata-bridge-<name>
attribute on the element.removeBridgeAttribute(name)
: Removes thedata-bridge-<name>
attribute on the element.click()
: Performs a click on the element.