how do i hide a p tag that my checkbox is sitting in?
<p><input type="checkbox" name="qID5[]" class="required" value="232" id="checkbox" /> - Answered NO to question 4 </p>
Here is some jquery that hides the checkbox itself depending on a condition but i actually want to hide the entire p. What do i change in the jQuery below to hide the p and everything in it rather than just the checkbox?
if(value == 184){
var $radios = $('input:checkbox[name=qID5[]]');
$radios.filter('[value=232]').attr('checked', true);
$radios.filter('[value=232]').show();
}else{
var $radios = $('input:checkbox[name=qID5[]]');
$radios.filter('[value=232]').attr('checked', false);
$radios.filter('[value=232]').hide();
}}
Use
.parentto get the enclosing<p>tag. See below.