課程
/前端開發(fā)
/jQuery
/jQuery基礎(chǔ)(二)—DOM篇
prependTo('.aaron2')和prependTo($('.aaron2'))都可以執(zhí)行,效果也一樣,有什么區(qū)別?
2016-12-23
源自:jQuery基礎(chǔ)(二)—DOM篇 3-3
正在回答
jQueryObject.prependTo(selector)
其中selector:可以是String/Element/jQuery類型;
如果參數(shù)selector為字符串類型,則將其視作jQuery選擇器或html內(nèi)容字符串,jQuery會(huì)自行判斷。
這里prependTo('.aaron2')中selector為字符串類型,jQuery會(huì)默認(rèn)為jQuery選擇器,會(huì)自行查找$('.aaron2'),
所有和prependTo($('.aaron2'))效果一樣
非常感謝
舉報(bào)
jQuery第二階段開啟DOM修煉,了解創(chuàng)建、插入、刪除與替換
2 回答prepend()與prependTo()和before() 有什么區(qū)別
4 回答prependTo的問題
1 回答aaron2身上是有個(gè)clone事件嗎
3 回答appendTo()、prependTo()這種反向插入的必要用途又在哪里呢?
2 回答為什么把this改成".aaron2"之后是以倍數(shù)增加div的
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-12-23
jQueryObject.prependTo(selector)
其中selector:可以是String/Element/jQuery類型;
如果參數(shù)selector為字符串類型,則將其視作jQuery選擇器或html內(nèi)容字符串,jQuery會(huì)自行判斷。
這里prependTo('.aaron2')中selector為字符串類型,jQuery會(huì)默認(rèn)為jQuery選擇器,會(huì)自行查找$('.aaron2'),
所有和prependTo($('.aaron2'))效果一樣
2016-12-23
非常感謝