Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referenceing an object containing another object

Status
Not open for further replies.

Ebow

Programmer
Oct 11, 2002
24
IE
Hi,

I have a javascript object, but to make it work I need to pass a reference to the object that contains the current object in the constructor.

For example, if it is contained just within the body of the html document, I can pass document.body fine, but the problem arises when I put it into a table. It is contained, ultimately, by <td> tags but obviously <tr> then <table> come before that.

Anyone have any ideas how I can reference the containing object if it is a table?

Thanks :)
 
give the Cell an ID, say &quot;CellID&quot; for example, this way you can reference it by saying

document.CellID

or

document.getElementById(&quot;CellID&quot;)

pass that in as the reference
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top