Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var el = document.getElementById('someElementId'); // получаем элемент из DON
- el.setAttribute('data-active', '1'); // устанавливаем значение атрибута data-active = 1
- var val = el.getAttribute('data-active'); // простое чтение данных атрибутов
Advertisement
Add Comment
Please, Sign In to add comment