I have four div's which were cloned from another 4 div's. The cloned div's have new id's. When one of the new div's is selected and I do $(this).siblings(), I am getting back the 4 new div's instead of 3. I am not sure why this is happening and if cloning messed something up.
Is there a way to make siblings work right in my case? Is there a way to select the other 3 div's without using siblings(开发者_C百科)?
Thanks to Rocket for giving me the idea for not()
. However not(this)
didn't work.
I had to $(this).siblings().not('#' + $(this).attr("id"))
;
精彩评论