KW Online Tools Zone
Knowledge Walls
View All Tools Home
HOW TO ADD ACTIVE CLASS TO CURRENT PAGE LINK USING JQUERY
[Jquery editor]
Run
Share Link
Clear
HTML [Ctrl+Enter] - to run
Data
Data
Data
Data
Data
CSS [Ctrl+Enter] - to run
.colorIt { background-color: yellow; }
Jquery [Ctrl+Enter] - to run
$(function(){ $('a[href^="'+document.location+'"]').parent().addClass("colorIt"); });
OUTPUT
Copyright © 2021 Knowledge walls, All rights reserved
Copyright © 2021 Knowledge walls, All rights reserved