Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose elements but exclude first and last elements

Tags:

jquery

How to process element excluding the first and last one. I have a table with a given number of rows. I want to trigger the rows on a click event but should not process the click if first or last row is clicked. How can I implement this?

like image 641
kratz Avatar asked Sep 17 '09 14:09

kratz


1 Answers

How about:

$('tr:not(:first, :last)').click(function() {
    // ...
})

?

like image 100
Roatin Marth Avatar answered Oct 09 '22 16:10

Roatin Marth