Any of these should do the trick: $('#inp').parent().parent().find('td').size(); $('#inp').parents('tr').find('td').size(); $('#inp').parents('tr').children().size(); $('#inp').parent().siblings().size() + 1;
- jason On Apr 1, 6:13 am, Emil Zegers <[EMAIL PROTECTED]> wrote: > Hello, > > I have HTML code like this: > > <table> > <tr> > <td> > </td> > <td> > <input id="inp"> > </td> > <td> > </td> > </tr> > </table> > > I want to know have many table cells are in the row and have to start > querying from the input element. > > When I query $("#inp").parent("td").parent("tr").$("td").length it fails with > the message: > > $("#inp").parent("td").parent("tr").$ is not a function > > The following queries do work: > > $("#inp").parent("td").parent("tr").length > $("td").length > > Any ideas or other ways to get this working? > > Regards, > > Emil Zegers