gijsroge/priority-navigation

About label of "navDropdownLabel" in data attributes

parnasmi opened this issue · 2 comments

Hi there.
Is it possible to "pull out" label text from html5 data attribute? If yes, how? Thank you very much in ahead.

Yes thats possible. Just read the data attribute with javascript and set it as the value for the "navDropdownLabel" option.

html:
<ul data-dropdown-label="more ▾"></ul>
js:
navDropdownLabel: document.querySelector('[data-dropdown-label]').dataset.dropdownLabel

Thank you very much!