I have a table structure, like this:
[code]
<table>
<tr><td><div>blah blah</div>blah blah</td></tr>
<tr><td><div>blah blah blah</div></td></tr>
<tr><td>blah</td></tr>
</table>
What I want to do is a function that takes as an argument any element in this table and creates a class that stores the table as “table”, the first <tr> as “tBar”, the div in the second <tr> as “content” and the last <tr> as “sBar”. All works fine in Firefox but unfortunately, IE isn’t able to find the div from the second <tr>. Here’s what I have:
[code]
var activeObj = {
table: “”,
tBar: “”,
content: “”,
sBar: “”
}
function getTable(obj) {
if (obj.tagName.toLowerCase()==”table”) return obj;
else return getTable(obj.parentNode);
}
function fillObjClass(obj) {
activeObj.table = getTable(obj);
activeObj.tBar = activeObj.table.firstChild.nextSibling.firstChild;
activeObj.content = activeObj.table.getElementsByTagName(“DIV”)[1]; // IE says “Object required”
activeObj.sBar = activeObj.table.firstChild.nextSibling.lastChild.previousSibling;
}
Please help… I’m running out of ideas…