[jQuery] Strange behavior with append() and nested DOM nodes...
Hi all,
good to see the mailing list is working agagin...
just wanted to let you know, that I experienced some strange behavior
when using append() together with nested DOM nodes. Actually I am using
Micheal Gearys cool DOM creation plugin
(http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype):
If I am creating a form like this:
var form = $.FORM({action: "/start.php", method: "post"},
$.FIELDSET({},
$.P({},
$.LABEL({"for": "dyn-username"}, "Username"),
$.INPUT({id: "dyn-username", type: "text", name:
"username", value: ""})
),
$.P({},
$.LABEL({"for": "dyn-password"}, "Password"),
$.INPUT({id: "dyn-password", type: "password", name:
"password", value: ""})
),
$.P({className: "form-handle"},
$.INPUT({className: "submit", type: "submit", value: "Let
me in"}),
$.INPUT({className: "submit", type: "button", value: "Cancel"})
)
)
);
and then try to append that single node like this
$("#np-login").append(form);
that doesn't work correctly. But if I am passing the form as a single
list item, everything is fine:
$("#np-login").append([form]);
So I am now always passing DOM nodes as an array, just to be sure. Thats
OK with me, but maybe I just didn't get things right?
Regards,
--Klaus
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/