SanSYS

Untitled

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