jQuery insertAfter() နည်းလမ်း
❮ jQuery HTML/CSS နည်းလမ်းများ
ဥပမာ
<p> ဒြပ်စင်တစ်ခုစီ၏နောက်တွင် <span> ဒြပ်စင်တစ်ခုကို ထည့်ပါ-
$("button").click(function(){
$("<span>Hello world!</span>").insertAfter("p");
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
insertAfter() နည်းလမ်းသည် ရွေးချယ်ထားသော ဒြပ်စင်များပြီးနောက် HTML အစိတ်အပိုင်းများကို ထည့်သွင်းသည်။
အကြံပြုချက်- ရွေးချယ်ထားသော ဒြပ်စင်များရှေ့တွင် HTML အစိတ်အပိုင်းများကို ထည့်သွင်းရန် insertBefore() နည်းလမ်းကို အသုံးပြုပါ။
အထားအသို
$(content).insertAfter(selector)
Parameter | Description |
---|---|
content | Required. Specifies the content to insert (must contain HTML tags). Note: If content is an existing element, it will be moved from its current position, and inserted after the selected elements. |
selector | Required. Specifies where to insert the content |
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
ဒြပ်စင်တစ်ခုကို ထည့်သွင်းရန် insertAfter() နည်းလမ်းကို အသုံးပြုနည်း။
❮ jQuery HTML/CSS နည်းလမ်းများ