[jQuery] Binding to multiple items with one call

[jQuery] Binding to multiple items with one call

<HTML>
<HEAD>
<TITLE>Re: [jQuery] Binding to multiple items with one call</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Thanks, perfect.  I didn’t see any examples of entering multiple items and trying to do a search through the list wasn’t coming up with what I needed.<BR>
<BR>
<BR>
On 3/29/07 9:49 AM, "Karl Swedberg" <karl@englishrules.com> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>I think you just have a couple extra single-quotes in there:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> $j('#person', '#assigned').blur(function() { sendok=true;<BR>
alert(sendok);} );<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
the selector here is trying to get the #person element within the context of the #assigned  element. if you want to get both, you need to enclose them in the same set of quotation marks like this:<BR>
<BR>
   $j('#person, #assigned').blur(function() { sendok=true;<BR>
      alert(sendok);} );<BR>
<BR>
<BR>
<BR>
--Karl<BR>
_________________<BR>
Karl Swedberg<BR>
www.englishrules.com<BR>
www.learningjquery.com<BR>
<BR>
<BR>
 <BR>
<BR>
On Mar 29, 2007, at 12:22 PM, Shelane Enos wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>This doesn't seem to be working:<BR>
bindBlur = function(){<BR>
        $j('#person', '#assigned').blur(function() { sendok=true;<BR>
alert(sendok);} );<BR>
    }<BR>
<BR>
But this does:<BR>
<BR>
bindBlur = function(){<BR>
        $j('#person').blur(function() { sendok=true; alert(sendok);} );<BR>
    }<BR>
<BR>
<BR>
Do I have to do them all individually or am I just putting those IDs in<BR>
incorrectly?<BR>
<BR>
<BR>
_______________________________________________<BR>
jQuery mailing list<BR>
discuss@jquery.com<BR>
<a href="http://jquery.com/discuss/">http://jquery.com/discuss/</a><BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:10.0px'>_______________________________________________<BR>
jQuery mailing list<BR>
discuss@jquery.com<BR>
<a href="http://jquery.com/discuss/">http://jquery.com/discuss/</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:10.0px'><BR>
</SPAN></FONT></FONT>
</BODY>
</HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




































































    • Topic Participants

    • senos