jQuery appendTo() နည်းလမ်း
❮ jQuery HTML/CSS နည်းလမ်းများ
ဥပမာ
<p> ဒြပ်စင်တစ်ခုစီ၏အဆုံးတွင် <span> ဒြပ်စင်တစ်ခုကို ထည့်ပါ-
$("button").click(function(){
$("<span>Hello World!</span>").appendTo("p");
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
appendTo() နည်းလမ်းသည် ရွေးချယ်ထားသော ဒြပ်စင်များ၏အဆုံးတွင် HTML အစိတ်အပိုင်းများကို ထည့်သွင်းသည်။
အကြံပြုချက်- ရွေးချယ်ထားသော ဒြပ်စင်များ၏အစတွင် HTML အစိတ်အပိုင်းများကို ထည့်သွင်းရန်၊ prependTo() နည်းလမ်းကို အသုံးပြုပါ။
အထားအသို
$(content).appendTo(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 at the end of the selected elements. |
selector | Required. Specifies on which elements to append the content to |
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
ရွေးချယ်ထားသည့်ဒြပ်စင်တစ်ခုစီ၏အဆုံးတွင် ရှိပြီးသားဒြပ်စင်တစ်ခုကို ထည့်သွင်းရန် appendTo() နည်းလမ်းကို အသုံးပြု၍ လက်ရှိဒြပ်စင်တစ်ခုကို ထည့်သွင်းနည်း
❮ jQuery HTML/CSS နည်းလမ်းများ