How to filter the current item from the list of items. Eg.
$('.div').click(
function (){
$(this).val('this is clicked');
//! get the items that are not clicked
}
)
$('.div')
returns a list of items, and one of them is clicked. How to get the list of item, that are not clicked.
Note: I am not looking the solution that adds attribute to the clicked item (or unlicked item) and filters it.
$('.div').click(
function (){
$(this).val('this is clicked');
var others = $(".div").not($(this));
}
)
Try the siblings selector:
$(this).siblings()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With