Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

select element as role in jquery

// remove active class from all elements
document.querySelectorAll('[role="presentation"]').forEach(function (el){
el.classList.remove("active");
});

// add class 'active' to last element
document.querySelectorAll('[role="presentation"]:last-of-type')[0].classList.add("active")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #element #role #jquery
ADD COMMENT
Topic
Name
1+8 =