Answers for "document.getElement class"

16

getelementbyclass

var selector = document.getElementsByClassName('class-name');
Posted by: Guest on May-25-2020
2

element.classname javascript

let el = document.getElementById('item');

if (el.className === 'active'){
  el.className = 'inactive';
} else {
  el.className = 'active';
}
Posted by: Guest on August-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language