jQuery: How would I show/hide these elements?

Posted by Shpigford on Stack Overflow See other posts from Stack Overflow or by Shpigford
Published on 2011-01-05T21:37:41Z Indexed on 2011/01/05 21:53 UTC
Read the original article Hit count: 281

Here's my HTML:

<ul>
  <li>
    <p><label><input type="checkbox" name="permission" value="1" class="permission_check" checked> Joe Schmoe</label></p>
    <p class="radio_option"><label><input type="radio" name="viewpromote" value="1"> View and Promote</label></p>
    <p class="radio_option"><label><input type="radio" name="createedit" value="1" checked> ...plus Create and Edit</label></p>
  </li>
  <li>
    <p><label><input type="checkbox" name="permission" value="1" class="permission_check" checked> Bob Smith</label></p>
    <p class="radio_option"><label><input type="radio" name="viewpromote" value="1" checked> View and Promote</label></p>
    <p class="radio_option"><label><input type="radio" name="createedit" value="1"> ...plus Create and Edit</label></p>
  </li>
</ul>

What I need to do is when a user checks/unchecks the permission_check input, then it should show/hide the radio_option elements for that list item.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery