Reputation: 14318
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.
Upvotes: 8
Views: 3374
Reputation: 14268
$('.div').click(
function (){
$(this).val('this is clicked');
var others = $(".div").not($(this));
}
)
Upvotes: 9