javascript - IE 8 nextSibling Property behaving weirdly -


i using following markup code in project.

<td>     <a style="font-size: small" id=maincontent_refdatamgr_gridregion_lblregionname_8 title="click select row" onclick=javascript:onrowclick(this); href="javascript:__dopostback('ctl00$maincontent$refdatamgr$gridregion$ctl10$lblregionname','')">test </a>     <input id=maincontent_refdatamgr_gridregion_hdnregionid_8 value=82 type=hidden name=ctl00$maincontent$refdatamgr$gridregion$ctl10$hdnregionid>  </td>      function onrowclick(objrow) {                   var hdnselectdgridrowregionid =   document.getelementbyid('<%=hdngridrowselectedregionid.clientid%>');                        hdnselectdgridrowregionid.value = objrow.nextsibling.nextsibling.value;                  } 

so if anchor element contains space in text (test ) objrow.nextsibling.nextsibling.value not working , have use objrow.nextsibling.value in chrome it's working fine if text contains space or not.

please let me know region this.

thanks in advance.

in ie8 .nextsibling (correctly, imho) refers text node next <a>.

however, text nodes don't have value.

you want .nextelementsibling.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -