Friday, December 28, 2012

HTML JS publish click-events to all childs

I have tables with one radio button per cell and its quite annoying to aim at the radio button completely...
<td onclick="for (var i in this.childNodes) 
if(typeof this.childNodes[i].click === 'function') 
    this.childNodes[i].click();">
  Just clickable text
  <input type="radio" />
</td>

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.