Hi all,
I'm very new to this, and can't figure it out how to do this, please help:
What I'm trying to do is: when select grade = 3, AND class = english, AND radio checked yes, then show div.
Here's the code:
- <p>
- <select name="grade" id="grade">
- <option>1</option>
- <option>2</option>
- <option>3</option>
- <option>4</option>
- </select>
- </p>
- <p>
- <select name="class" id="class">
- <option>math</option>
- <option>history</option>
- <option>english</option>
- </select>
- </p>
- <p>
- <label>
- <input type="radio" name="Group1" value="yes" id="Group1_0">
- yes</label>
- <br>
- <label>
- <input type="radio" name="Group1" value="no" id="Group1_1">
- no</label>
- <br>
- </p>
- <div id="test" style="display:none">show/hide</div>
- <script type="text/javascript">
- $(document).ready(function(){
- var test = $('#test').hide();
- var class = $('#class');
- var Group1 = $('#Group1');
- $('#grade').change(function() {
- var value = this.value;
- if (value == 3) {
- if (Group1.attr("checked", "checked")) {
- test.fadeIn();
- } else {
- test.fadeOut();
- }}
- });
- });
- </script>
- Thank
- John