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.
我$('.posts').append('test')用来添加“测试”作为帖子中的最后一个元素div。我怎样才能使它成为第一个元素?
$('.posts').append('test')
div
与.prepend()喜欢一起使用
.prepend()
$('.posts').prepend('test');
试试这个链接
你用 prepend()
prepend()
('.posts').prepend('test');