Script to uncover div
Script to uncover div
He,
I have this example code
- <div id="leveltwoget">
<div id="TWO-A"><br /><br />
<input type="checkbox" name="a[]" value="a">a<br /><br />
<div class="hide" id="three-TWO-A">
<input type="checkbox" name="a[]" value="b">b<br />
<input type="checkbox" name="a[]" value="c">c<br />
<input type="checkbox" name="a[]" value="d">d<br />
Write <input type="text" size="25" maxlength="50" name="pozostale[]" id="pozostale">
</div>
</div>
<div id="TWO-B"><br /><br />
<input type="checkbox" name="b[]" value="a">a<br /><br />
<div class="hide" id="three-TWO-B">
<input type="checkbox" name="b[]" value="b">b<br />
<input type="checkbox" name="b[]" value="c">c<br />
<input type="checkbox" name="b[]" value="d">d<br />
Write <input type="text" size="25" maxlength="50" name="pozostale[]" id="pozostale">
</div>
</div>
</div>
$("#leveltwoget").change(function() {
var threename=null;
$(this).find('div').each(function() {
if ($(this).attr('checked'))
threename= $(this).attr('id');
});
if (threename.is(':cheked')) {
$("#three-TWO-A?????").slideDown("middle");
} else {
$("#three-TWO-A?????").slideUp("middle");
}
});
I want to hide or uncover div element.
This script should work in this way: If I checked one of two checkbox a in div TWO-A should uncover div id="three-TWO-A" or if I checked a in div TWO-B should uncover div id="three-TWO-B" .
The name of div id="TWO-A" and id="TWO-B" and id="three-TWO-A" and id="three-TWO-B" is dynamic so I use find and each options.
I wrote this jquery script my self but it dosen't work.
Can anyone help me?