[jQuery] Get attribute form $()

[jQuery] Get attribute form $()

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=765024704-26092006><FONT face="Trebuchet MS"
size=2>Or to stay with jQuery objects:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=765024704-26092006><FONT face="Trebuchet MS"
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=765024704-26092006><FONT face="Trebuchet MS"
size=2>$('type', line).eq(0).val()</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com] <B>On Behalf Of </B>Blair
McKenzie<BR><B>Sent:</B> Monday, September 25, 2006 7:53 PM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> Re: [jQuery] Get attribute form
$()<BR></FONT><BR></DIV>
<DIV></DIV>I don't know about the other stuff, but get() is the exception to the
chaining rule - it's purpose is to provide access to the underlying element when
necessary. Try<BR>$("type",line).get(0).value<BR><BR>
<DIV><SPAN class=gmail_quote>On 9/26/06, <B class=gmail_sendername>Donny
Kurnia</B> <<A
href="mailto:donnykurnia@gmail.com">donnykurnia@gmail.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">I've
got this result while debugging with firebug:<BR><BR>>>>
$("type",line)<BR>[<type value="select">]<BR>>>>
$("type",line).attr("value")<BR>--result nothing <BR>>>>
$("type",line).get(0)<BR><type value="select"><BR>>>>
$("type",line).get(0).attr("value")<BR>--result nothing<BR><BR>How do I got
the value attribute from $("type",line) without assign it <BR>to another
variable?<BR>Why chainable method didn't work for $().get()
??<BR><BR>--<BR>Donny Kurnia<BR><A
href="http://hantulab.multiply.com/">http://hantulab.multiply.com/</A><BR><A
href="http://hantulab.blogspot.com/">http://hantulab.blogspot.com/</A><BR>-------------------------------------------<BR>At
times the world can seem an unfriendly and sinister place. But<BR>believe us
when we say there is much more good in it than bad. And<BR>what might seem to
be a series of unfortunate events, may in fact, be<BR>the first steps of a
journey.<BR>-- A Series of Unfortunate
Events<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></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/