Wednesday, 2 October 2013

jQuery slideDown example with some constraints

jQuery slideDown example with some constraints

I want to find the div-container with the class ".div1", which contains a
radio button with the value 100 and this container should slideDown().
Following command does not work:
$('.div1 :input[value="100"]').slideDown();
the HTML Structure looks:
<div class="div1">
<span>some text div1</span>
<span>
<input class="ca" type="radio" name="hello" val="100">
<input class="ca" type="radio" name="hello" val="200">
</span>
</div>
<div class ="div2">
<span>some text div2</span>
<span>
<input type="radio" name="hi" val="300" class="cb">
<input type="radio" name="hi" val="400" class="cb">
</span>
</div>
and that's the css:
.div1,.div2 {
display: none;
}

No comments:

Post a Comment