c# - javascript nextSibling in table -


first of all, have searched , searched @ many posts on site. suggestions did not work. thought 1 may work did not: how nextsibling after first nextsibling?

here table in question:

<table> <tr>     <td><%#databinder.eval(container, "dataitem.name")%>:</td>     <td><asp:dropdownlist id="ddlinput" runat="server" onchange="swapit(this);" />     </td>     <td>         <asp:textbox id="txtinput" runat="server" maxlength="1000" width="120" />     </td>     <td>         <asp:checkbox id="cbinput" runat="server" />     </td> </tr> </table> 

and here javascript

function swapit(ddlctl) { var inputctl = ddlctl.nextsibling; inputctl = inputctl.nextsibling;  alert(inputctl.nodename);  //if (inputctl.nodename == "input") { if (inputctl.nodename == "#text") {     if (ddlctl.value == "-1")         inputctl.style.display = "inline";     else         inputctl.style.display = "none"; } } 

this should bring nodename input brings #text instead. also, need mention table in datalist inside updatepanel , onchange attribute being set c# code behind.

i have tried many variations of , can't seem find correct way.

thanks!


Comments