nice one, and it is not jQuery
onload = function(){
var c = document.createElement("input");
c.setAttribute("type", "checkbox");
document.body.appendChild(c);
c.setAttribute("checked", "checked");
alert(c.checked); // true
document.body.removeChild(c);
document.body.appendChild(c);
alert(c.checked); // false
};
tested in both IE emulator and IE SP2 under XP VM ... same behavior
On Wed, Aug 19, 2009 at 10:27 AM, <[email protected]> wrote:
>
> Hello list,
>
> Not sure if this is the right place to ask this but here goes. I might
> have discovered an issue with jquery under IE6. It seems a checkbox
> doesn't keep it's state after it is appended to another element. The
> following piece of code reproduces the issue. Can someone shed some light
> on this?
>
> Thanks in advance,
>
> - Emiel van de Laar
>
> --
>
> <html>
> <head>
> <script type="text/javascript"
> src="jquery-nightly.js"></script>
> <script type="text/javascript">
> $(document).ready(function() {
> var state = true;
> var cb = $('<input
> type="checkbox">');
> cb.attr('checked', state);
> alert("before: " +
> cb.attr('checked'));
> $('p').append(cb); // Calling append
> loses checkbox state in IE 6.
> alert("after: " +
> cb.attr('checked'));
> });
> </script>
> </head>
> <body>
> <p>
> </body>
> </html>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---