getDataTarget function

String getDataTarget (
  1. Element element
)

Retrieve the value of data-target attribute of href attribute on given element.

Implementation

String getDataTarget(Element element) =>
    element.attributes['data-target'] ?? element.attributes['href'];