why not do this

$('span.mycategory').length

(I've not worked with jquery and xml so I don't know anything about it)



ml1 wrote:
I have something very strange going on trying to create a wrapped set
of elements from an xml file loaded via jquery's xmlhttprequest.   The
xml has a number of entries with class attributes that have multiple
values, ie <span class="mycategory mychoice" ...>...</span>

When I use this selector:

   $('span[class*=mycategory"],xml).length

jquery returns zero.  Weirdly if I do exactly the same thing but use a
different attribute name from "class" in the xml and the query, it
works perfectly.

If I use this method I get the expected result:

   $('span').attr('class')

It returns "mycategory mychoice"

Is there something special about the "class" attribute in xml that is
causing this?

Reply via email to