Reputation: 1797
I have a massive table and i want to be able to click on the and go to another page. However I dont want to allow the click through on the first and the last . So its everything in between really.
$(".dataTable td").click(function(){
window.location.href = "LINK";
});
Cheers
Upvotes: 1
Views: 555
Reputation: 388316
$(".dataTable td").not(':first-child, :last-child').on('click', function(){
window.location.href = "LINK";
});
Upvotes: 0
Reputation: 71140
Use:
$('.dataTable td:not(:first-child, :last-child)').click(function(){
window.location.href = "LINK";
});
Upvotes: 2