About label of "navDropdownLabel" in data attributes
parnasmi opened this issue · 2 comments
parnasmi commented
Hi there.
Is it possible to "pull out" label text from html5 data attribute? If yes, how? Thank you very much in ahead.
gijsroge commented
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
parnasmi commented
Thank you very much!