[jQuery] setting an attribute... I *thought* this was how to doit...
<!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.5730.11" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=825111200-05012007>Try lowercase.</SPAN></FONT></DIV><FONT face=Arial
color=#0000ff size=2></FONT><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>Christopher
Jordan<BR><B>Sent:</B> Thursday, January 04, 2007 6:15 PM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> [jQuery] setting an attribute... I *thought* this
was how to doit...<BR></FONT><BR></DIV>
<DIV></DIV><FONT size=-1><FONT face="Courier New, Courier, monospace">Hi
folks,<BR><BR>I've got another simple question. Is this not how you set an
element's attribute?<BR>[from inside an
.each()]<BR><BR>$(this).attr("AttributeName", "Value");<BR><BR>I thought that
worked... I thought it had worked for me in the past.<BR><BR>Is there any reason
that this wouldn't work:<BR><BR>var i =
1;<BR>$("div.OrderEntryListRow").not(".Selected").each(function(){<BR>
alert("before: " + $(this).attr("ID"));<BR> $(this).attr("ID",
"Row_" + i);<BR> alert("after: " +
$(this).attr("ID"));<BR> i++;<BR>});<BR><BR>In this sample
code above, the before and after alerts are identical. Is there something else
I'm missing?<BR><BR>I think I've got the above idea correct, but wanted to get
some different eyes to look at it with
me.<BR><BR>Thanks,<BR>Chris<BR></FONT></FONT><PRE class=moz-signature cols="72">--
<A class=moz-txt-link-freetext href="http://www.cjordan.info">http://www.cjordan.info</A></PRE></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/