Last active
December 2, 2023 18:34
-
-
Save softiconic/b8b851c5ad09bf5da31bcb60856ae5c4 to your computer and use it in GitHub Desktop.
Add or remove a class in a section-based loop for multiple items.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('.scshow').click(function() { | |
var parentDiv = $(this).closest('.scteto'); | |
if (parentDiv.hasClass('highlighted')) { | |
parentDiv.removeClass('highlighted'); | |
} else { | |
parentDiv.addClass('highlighted'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment