Hi folks, I'm posting this again, because I'm not sure it made it
through the first time. Sounds like a user error to me! :o)
Anyway...
I've got another simple question. Is this not how you set an element's
attribute?
[from inside an .each()]
$(this).attr("AttributeName", "Value");
I thought that worked... I thought it had worked for me in the past.
Is there any reason that this wouldn't work:
var i = 1;
$("div.OrderEntryListRow").not(".Selected").each(function(){
alert("before: " + $(this).attr("ID"));
//$(this).attr("ID", "Row_" + i);
ThisNewRow = "Row_" + i;
$(this).attr("ID", ThisNewRow);
alert("after: " + $(this).attr("ID"));
i++;
});
What I'm expecting is that all the elements regardless of their current
ID will have those IDs reordered starting with 1. In this sample code
above, I should see "before: Row_4", and "after: Row_1", like that.
Instead I'm getting, "before: Row_4", and "after: Row_4". Is there
something else I'm missing about setting an element's attribute?
I think I've got the above idea correct, but wanted to get some
different eyes to look at it with me. I've tried several different
things to get this going both jQuery and plain ol' JavaScript. This is
holding up my progress on progress on my current project which has a
deadline fast approaching.
Can someone please help me? :o(
Thanks,
Chris
--
http://www.cjordan.info
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/