jQuery中append appendTo prepend prependTo insertBefore insertAfter after before之间的区别
jQuery中有一个很关键的元素操作,他们的使用方法都一样,但是呈现的结果有所不同. <! DOCTYPE html > < html lang ="en" > < head > < meta charset ="utf-8" > < title > test </ title > < script src ="jquery.js" ></ script > </ head > < style > p { background-color : aquamarine ; } </ style > < body > < p id ="n1" > < span id ="n2" > span#n2 </ span > n1 </ p > < p id ="n3" > < label id ="n4" class ="move" > label#n4 </ label > n3 </ p > < p id ="n5" > < span id ="n6" > span#n6 </ span > n5 </ p > < p id ="n7" > < span id ="n8" > span#n8 </ span > n7 </ p > < p id ="n9" > < span id ="n10" > span#n10 </ span > n9 </ p > < p id ="n11" > <