So this should be pretty simple, but it seems to be making me stumble. I have a drop down in a cell in a table. When that value is changed, I call a javascript function and pass that drop down in the function. How do i get the table from that? example code:
<table><tr>
<td>DATA</td>
<td><select id='leadState' onChange='updateData(this)'><option selected='selected' value='new'>New</option><option value='old'>Contacted</option></select></td>
</tr>
</table>
javascript:
function updateData(select) {
var table = select.parentNode.parentNode.parentNode;
var row = select.parentNode.parentNode;
var cell = select.parentNode;
}
Why does this not return the table properly?