First: are you sure parentElt is a jQuery object (not the same than a DOM object). Second: I would use parentElt.attr("id") instead (or $(parentElt).attr("id") in case the variable is not already a jQuery object). Hope this helps.
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