Thanks Karl and Olaf.  I got 2 methods to work so I feel ready to do the 
real code now.  Just one question, in the tutorials I saw lines like
q("[EMAIL PROTECTED]'sweets']") where what works here is 
q('select[name=sweets]').  When should the @ and quotes be used and when 
shouldn't they?

Belinda

On Wed, 17 Oct 2007, Karl Swedberg wrote:

> Belinda, you can also use the .change() method on the <select> element if you 
> want (the part you commented out was just fine).  Then you can either get the 
> selected option's value like this ...
>
> q(this).text()
>
> or its text like this ...
>
> q(':selected',this).text()
>
> As Olaf mentioned, the real problem was that you were trying to find 
> q('input[name=sweets]') when you should have been using 
> q('select[name=sweets]')
>
>
> --Karl
> _________________
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
> On Oct 17, 2007, at 8:54 PM, Olaf Bosch wrote:
>
>> 
>> Belinda M. Giardine schrieb:
>>> I have found this question in the archives and set up a test page based on 
>>> the responses I have found.  But for me it is not working, the section is 
>>> hidden and doesn't reappear no matter what is selected.  I have tried 
>>> several different browsers.  The real task is on a more complex page, I am 
>>> just trying to get the simple test to work first.
>> 
>> and here the full function:
>> 
>> q(document).ready(function(){
>>  q("div.subSection").hide();
>>  q("option").click (function() {
>>    var opt = q(this).text();
>>    alert (opt);                   // delete this row
>>    if (opt == "Cookie") {
>>      q("div.subSection").show();
>>    } else {
>>      q("div.subSection").hide();
>>    }
>>  });
>> });
>> 
>> 
>> -- 
>> Viele Gr??e, Olaf
>> 
>> -------------------------------
>> [EMAIL PROTECTED]
>> http://olaf-bosch.de
>> www.akitafreund.de
>> -------------------------------
>

Reply via email to