views:

14

answers:

2

iam having the table with id "someTable" where i have the rows dynamically from PHP i want to apply the contextmenu to every first td in every row .iam using the context menu plugin from here (http://www.trendskitchens.co.nz/jquery/contextmenu/)

        $("someTable td").contextmenu('mymenu')(function (){

    //would the above statement work
     });    
+1  A: 

Use the nth-child selector like this:

$("someTable td:nth-child(1)")

That will target every first td of the row.

Sarfraz
Really awesome! Thanks
Someone
+1  A: 

Use :first-child:

$("#someTable td:first-child")

:first-child will select all matching elements (the tds) that are the first child of their parent (the tr).

Andy E
Really awesome! Thanks
Someone
@Andy: What "function" Should i use if i want to apply for every row in the table
Someone