On 16/11/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Sam Collett schrieb:
> > Test case:
> > $(
> > function()
> > {
> > var action = $("<input type=hidden>").attr(
> > {
> > "name": "action",
> > "value": "delete"
> > });
> > alert(action[0].name); // name seems to be added fine
> > alert($("<form>").append(action).html()); // where has name
> > gone?
> > }
> >
> > )
> >
> > The first alert shows that name has been set, but when I get the html
> > it is not there. Happens in 1.0.3 (and did in 1.0.2)
>
> To name a field "action" is not a good idea anyway. It clashes with the
> form elements own action attribute (form.action anyone?), so maybe
> that's also the reason why it is gone...
>
>
> -- Klaus
It happens regardless of the name you give it:
$(
function()
{
var action = $("<input type=hidden>").attr(
{
"name": "whatdodo",
"value": "delete"
});
alert(action[0].name); // name seems to be added fine
alert($("<form>").append(action).html()); // where has name gone?
}
)
It is only a problem in IE.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/