jquery默认显示div [复制]

This question already has an answer here:

I have a page in which a query is run to see if a caller has forwarding enabled. The result page is a form that the user can use to make changes to his call forwarding if he chooses. the results from the query are either yes or no, and if yes, the forwarded to number. I am using jquery to hide the cfaDesc div if he selects the "disabled" radio button, that works great.

 $(document).ready(function() {
   $("div.cfaDesc").hide();

   $("input[name$='cfa']").click(function() {
       var test = $(this).val();

       $("div.cfaDesc").hide();
       $("#" + test).slideDown('slow');
   });
 });

my problem is the initial query. If he has it enabled, I need to show the cfaDesc div. with the above query, no matter what the result is, it will be hidden. I am not sure how to change the hide/show attribute based on the query that is run before this code.

this was previous question that i inadvertantly marked as answered when it wasnt. Here is my jfiddle: http://jsfiddle.net/K3jrK/

</div>

you're almost there. if you want the forward pane enabled by default, try this:

$(document).ready(function() {
   $("div.cfaDesc").hide();

   $("input[name$='cfa']").click(function() {
       var test = $(this).val();

       $("div.cfaDesc").hide();
       $("#" + test).slideDown('slow');
   });
   $('#cfaEnabled').show(); // show the enabled div by default
});

new fiddle: http://jsfiddle.net/nmbE6/