[jQuery] newbie question
[jQuery] newbie question
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=484014114-11082006><FONT face=Arial color=#0000ff size=2>Maybe
it's only valid if there's something before it? Otherwise you're trying to
select a child of nothing?</FONT></SPAN></DIV>
<DIV> </DIV>
<P><FONT size=2><!----------------//------<BR>andy matthews<BR>web
developer<BR>certified advanced coldfusion programmer<BR>ICGLink,
Inc.<BR>andy@icglink.com<BR>615.370.1530
x737<BR>--------------//---------></FONT> </P>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com]<B>On Behalf Of </B>Realazy XA Chen
<BR><B>Sent:</B> Friday, August 11, 2006 9:29 AM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> Re: [jQuery] newbie
question<BR><BR></FONT></DIV>Why "> div.item" is not a valid selector?
According to CSS Spec( <A
href="http://www.w3.org/TR/CSS2/selector.html#child-selectors">http://www.w3.org/TR/CSS2/selector.html#child-selectors</A>
), that is a <BR>
<H2><A name=child-selectors>Child selector.</A></H2><BR>
<DIV><SPAN class=gmail_quote>2006/8/11, Klaus Hartl <<A
href="mailto:klaus.hartl@stilbuero.de">klaus.hartl@stilbuero.de</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><BR><BR>Steve
Clay wrote:<BR>> Thursday, August 10, 2006, 8:59:42 PM, Realazy XA
Chen wrote:<BR>>>
$(".panel").click(function(){<BR>>> $(">
div.item",this).todosomethinghere();<BR>>> })<BR>><BR>> ">
div.item" isn't a valid selector. If jQuery doesn't fail it probably<BR>>
should be considered a bug. "div.item" is all that's
needed.<BR>><BR><BR><BR>It isn't a valid CSS selector, but I think it
works in jQuery and <BR>shouldn't be considered as a bug.<BR><BR>In some
cases you may have to do something like the
following:<BR><BR>$(this).find('> p') ...<BR><BR>I cannot think of
another way to do that.<BR><BR><BR>--
Klaus<BR><BR>_______________________________________________ <BR>jQuery
mailing list<BR><A
href="mailto:discuss@jquery.com">discuss@jquery.com</A><BR><A
href="http://jquery.com/discuss/">http://jquery.com/discuss/</A><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR><A href="http://realazy.org">realazy.org</A>
</BLOCKQUOTE></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/