[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread Charlie Griefer
Hi Karl: That clears it up completely. Thanks! Charlie On Thu, Sep 17, 2009 at 10:43 AM, Karl Swedberg wrote: > Hey Charlie, > It all comes down to the way the string is parsed. The Sizzle selector > engine uses a Regular Expression to detect whether an attribute selector is > being used: > >

[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread Karl Swedberg
Hey Charlie, It all comes down to the way the string is parsed. The Sizzle selector engine uses a Regular Expression to detect whether an attribute selector is being used: ATTR: /\[\s*((?:[\w\u00c0-\u_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?) \3|)\s*\]/, The parts of the regex that deal

[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread Charlie Griefer
Hi Karl: Hate to hijack the thread, but hopefully it's somewhat relevant to the original post. When I suggested the single quotes around the value 'bar', I was going off of what I saw in the docs at http://docs.jquery.com/Selectors/attributeEquals#attributevalue And the code sample: $("input[nam

[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread Karl Swedberg
On Sep 17, 2009, at 5:13 AM, Charlie Griefer wrote: Pretty sure you need single quotes around bar. alert($("input[name='bar']").val()); No. The single quotes are unnecessary. On Thu, Sep 17, 2009 at 1:27 AM, pritisolanki wrote: Thanks Ralph. I tried following alert($("input[name=bar

[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread Charlie Griefer
Pretty sure you need single quotes around bar. alert($("input[name='bar']").val()); On Thu, Sep 17, 2009 at 1:27 AM, pritisolanki wrote: > > Thanks Ralph. > > I tried following > > alert($("input[name=bar]").val()); > > and rather then showing it's value it alert undefined ??? why? > > I am so

[jQuery] Re: Simple CSS selector Question

2009-09-17 Thread pritisolanki
Thanks Ralph. I tried following alert($("input[name=bar]").val()); and rather then showing it's value it alert undefined ??? why? I am sorry if this is very basic question. On Sep 16, 4:11 pm, Ralph Whitbeck wrote: > Take out the @ in your attribute selectors.  The @ was depricated in jQue

[jQuery] Re: Simple CSS selector Question

2009-09-16 Thread Ralph Whitbeck
Take out the @ in your attribute selectors. The @ was depricated in jQuery 1.2 and taken out in 1.3. So your new selectors will look like... 1. $("input[name=bar]") 2. $("p[class]") documentation http://docs.jquery.com/Selectors/attributeHas#attribute http://docs.jquery.com/Selectors/attributeE