Created
November 11, 2021 19:58
-
-
Save 2thecrow/b11b829771f2779c81701c7faeb29035 to your computer and use it in GitHub Desktop.
simple tabs JQ
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
$('.some__tab').click(function (e) { | |
e.preventDefault(); | |
$('.some__tab').removeClass('some__tab--active'); | |
$('.some__tab-content').removeClass('some__tab-content--active'); | |
var href = $(this).attr('href'); | |
$(this).addClass('some__tab--active'); | |
$(href).addClass('some__tab-content--active'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment