On Nov 12, 2006, at 9:33 AM, Jörn Zaefferer wrote:
> I guess the complete documentation for expression needs a good
> facelift.
> Seems like the input selectors are not documented anywhere.
>
> There is :input, which selects all types of input element (input,
> button, textarea, select).
>
> Then there are a selectors for all types of input elements (:text,
> :file, :hidden, :password etc.)
This is really good to know! I just posted an entry on Learning
jQuery last night about selector expressions, but I had no idea
about :text, :file, or :password. I'll have to update the entry today!
By the way, for others on the list who might not know, :hidden can be
used for any element, not just inputs. There is a :visible selector,
too.
On Nov 12, 2006, at 10:30 AM, Truppe Steven wrote:
> Also $("#div/form :textarea") does not work and :text only returns all
> type="text" and not the textarea fields.
I'm a little shaky on XPath, but if the CSS equivalent of "#div/form"
is "#div > form", you could try something like this:
$('#div > form').find('textarea, :text')
That should get any textarea and text input in a form that is a child
of #div.
>
> Now the only question left is for what this attribute selectors are
> for
> |= *= ?
Near the bottom of http://jquery.com/docs/Base/Expression/CSS/,
you'll find the following:
> All attribute selectors are written like their XPath counter-parts
> (in that all attributes should begin with an @ symbol).
>
> * [EMAIL PROTECTED] an E element with a "foo" attribute
> * [EMAIL PROTECTED] an E element whose "foo" attribute value is
> exactly equal to "bar"
> * [EMAIL PROTECTED] an E element whose "foo" attribute value begins
> exactly with the string "bar"
> * [EMAIL PROTECTED] an E element whose "foo" attribute value ends
> exactly with the string "bar"
> * [EMAIL PROTECTED] an E element whose "foo" attribute value
> contains the substring "bar"
Hope that helps.
Karl
___________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/