phdphd Posted April 24, 2019 Share Posted April 24, 2019 Hi All, Let’s suppose I have this DOM : <div id="Hello"> <div class="level_11"> <div class="level_111"> <div class="level_112"> <div class="level_11"> <div class="level_111"> <div class="level_112" id="button_33"> <div class="level_11"> <div class="level_111"> <div class="level_112"> Using jQuery, and supposing that in the line below id equals 33, how do I select all <div class="level_111"> elements except the one that has the sibling with id="button_33" ? I tried something like $('#Hello').children('.level_11').children('.level_111').not(siblings('#button_'+id)) but that does not work. I get the error " siblings is not defined ". Thanks ! Quote Link to comment https://forums.phpfreaks.com/topic/308632-select-all-elements-that-do-not-have-a-sibling-with-a-specific-id/ Share on other sites More sharing options...
phdphd Posted April 24, 2019 Author Share Posted April 24, 2019 I've solved this with an "each" function. Quote Link to comment https://forums.phpfreaks.com/topic/308632-select-all-elements-that-do-not-have-a-sibling-with-a-specific-id/#findComment-1566291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.