Last active
October 27, 2022 21:39
-
-
Save tevashov/5172492 to your computer and use it in GitHub Desktop.
Hide all children div except a specific one #jQuery
This file contains hidden or 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
| $('#target div:not(#exclude)').hide(); | |
| //or | |
| $('#target').children().filter(':not(#exclude)').hide(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code worked for me. You can replace $(this).val() with #target
$('.'+ $(this).val()).show(); $('.tabcontent2 tr:not(.'+ $(this).val() +')').hide();