KW Online Tools Zone
Knowledge Walls
View All Tools Home
REMOVEADDCLASS
[Jquery editor]
Run
Share Link
Clear
HTML [Ctrl+Enter] - to run
click here to add class name 'selected' with next element
After click the element the selected class css applied here
click here to remove class name 'selected' from the above element
CSS [Ctrl+Enter] - to run
.selected{ color:red; font-size:20px; }
Jquery [Ctrl+Enter] - to run
$(document).ready(function(){ $(".one").click(function(){ $(".two").addClass('selected'); }); $(".three").click(function(){ $(".two").removeClass('selected'); }); });
OUTPUT
Copyright © 2021 Knowledge walls, All rights reserved
Copyright © 2021 Knowledge walls, All rights reserved