You could also try this:
$('#mylist').append('<li id="'+ listItemId +'" value="' + ($('#mylist >
li').size() + 1) + '">' + textToShow + '</li>');
Cheers,
-js
On 2/6/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:
Joel Noble schrieb:
> I've got a little code snippit that adds LI elements to an
> ordered list (OL). In Firefox, the added elements get their
> own numbers and all is good. In IE, every element is added
> as #1. (The LI is added, but each one shows as #1).
>
> Here's what I'm doing to add the elements:
>
> $('#mylist').append('<li id="'+ listItemId +'">' + textToShow +
'</li>');
>
> Is there anything I can call after adding to prompt IE
> to "renumber" the elements of the OL?
>
>
> Thanks!
Joel, you could try to set the value manually with the value attribute -
it is deprecated in HTML 4 although:
var addedLi = $('<li id="'+ listItemId +'">' + textToShow +
'</li>').appendTo('#mylist');
if ($.browser.msie) {
addedLi.attr('value', theValue);
}
The only thing you need to do is to figure out the correct value (if it
works at all that is).
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/