Thanks for everyone's respnses. attr("id") did the trick. - Dave
On Apr 18, 3:18 pm, "Brad Perkins" <[EMAIL PROTECTED]> wrote: > Dave, > > I asked a similar question awhile ago and was told that id() and > name() were removed in a prior version to clean up the jQuery API. I'd > written some code based on examples from the mailing list archive and > was getting the not a function error too. Use .attr("id") and > .attr("name") instead. > > On 4/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I have this expression > > > var parentElt = $("#newTabText").parents("td.topTab:first"); > > alert(parentElt.id()); > > > and I'm getting a JS error on the second line, "id" is not a > > function. I have verified, through another alert statement, that > > "parentElt" is non-empty, contains a value, and has an "id" > > attribute. What expression should I write to get the proper id? > > > Thanks, - Dave