- When you use active selector on a link it will activate when?
- Can we use active on any tag?
- How do I set active class on click?
When you use active selector on a link it will activate when?
The :active selector is used to select and style the active link. A link becomes active when you click on it.
Can we use active on any tag?
:active can also apply to any element. In the Pen below, clicking anywhere on the page will make the whole page yellow: HTML.
How do I set active class on click?
on('click','li',function() $(this). addClass("active"); // adding active class ); The above code will add the active class to the li tag whenever the user clicks on the Li element.