Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 div 直接附加到窗口对象?
<html> <head> </head> <body> <div><div> <ul>..</ul> </body> </html>
我想在 ul 之后附加一个元素,但不是像 $('ul').after(element) 这样的东西,我只想将它直接附加到正文。谢谢
$("body").append(element);或者$(element).appendTo("body");
$("body").append(element);
$(element).appendTo("body");