priority-navigation icon indicating copy to clipboard operation
priority-navigation copied to clipboard

About label of "navDropdownLabel" in data attributes

Open parnasmi opened this issue 7 years ago • 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.

parnasmi avatar Feb 27 '18 16:02 parnasmi

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

gijsroge avatar Feb 27 '18 21:02 gijsroge

Thank you very much!

parnasmi avatar Mar 01 '18 08:03 parnasmi