Hi Feesh,
$('product_list').options returns all the OPTION element nodes since
the element with id='product_list' is a select element (I don't know
if all browser DOMs support the options attribute, so it may not be a
good cross-browser method, but it might be:
http://aptana.com/reference/api/HTMLSelectElement.html#HTMLSelectElement.options).

 $('product_list').childNodes returns an array containing all of your
OPTION elements (as well as anything else you put in the SELECT node)
and is a general way of getting a nodes childNodes.

You will probably find "\n" text nodes mixed in with the OPTION nodes
in the childNodes array, which is annoying.
There are many ways to get around and even avoid this problem.

For a MochiKit way of doing what you want, I would recommend against
using the MochiKit Selector module; instead, use a function from the
DOM module called getElementsByTagAndClassName:

var products = MochiKit.DOM.getElementsByTagAndClassName('option',
null, 'product_list');

This should always work.

-Dorian

On Nov 12, 2007 11:37 AM, feesh <[EMAIL PROTECTED]> wrote:
>
>
>
> [EMAIL PROTECTED] wrote:
> >
> > Hi Feesh,
> > It looks like you need to spell MochiKit with a capital K in your
> > myLoadFunction. I've stumbled on that error a few times.
> >
>
> You got it exactly right. Thank you kindly.
>
> One further question, I'm trying to select all child elements of a select
> list. I've tried every combination of selector and cannot figure it out:
>
> xhtml:
> <select multiple="multiple" name="product_list" id="product_list">
> <option value="1">1</option>
> <option value="2">2</option>
> </select>
>
> What I've tried:
> var products = $$("#product_list");
> var products = $$("select#product_list");
> var products = findChildElements("select","#product_list");
> etc.
>
> Any ideas?
> --
> View this message in context: 
> http://www.nabble.com/Connect-Issues-tf4754570.html#a13712572
>
> Sent from the MochiKit mailing list archive at Nabble.com.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to