Jquery提供两种将元素插入到其他元素前面的方法:.insertBefore()和.before(),另外两个方法.insertAfter()和.after(),也具有相同的关系。
直接看代码:
直接看代码:
$(document).ready(function(){
$('<a href="#top">back to top</a>').insertAfter("#daqie");
$('<a id="top"></a>');
});