Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About label of "navDropdownLabel" in data attributes #32

Open
parnasmi opened this issue Feb 27, 2018 · 2 comments
Open

About label of "navDropdownLabel" in data attributes #32

parnasmi opened this issue Feb 27, 2018 · 2 comments

Comments

@parnasmi
Copy link

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

@gijsroge
Copy link
Owner

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
Copy link
Author

parnasmi commented Mar 1, 2018

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants