jQuery prepend() နည်းလမ်း
❮ jQuery HTML/CSS နည်းလမ်းများ
ဥပမာ
<p> အစိတ်အပိုင်းအားလုံး၏အစတွင် အကြောင်းအရာကို ထည့်သွင်းပါ-
$("button").click(function(){
$("p").prepend("<b>Prepended text</b>");
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
prepend() နည်းလမ်းသည် ရွေးချယ်ထားသော အစိတ်အပိုင်းများ၏ အစတွင် သတ်မှတ်ထားသော အကြောင်းအရာကို ထည့်သွင်းသည်။
အကြံပြုချက်- ရွေးချယ်ထားသော အစိတ်အပိုင်းများ၏ အဆုံးတွင် အကြောင်းအရာကို ထည့်သွင်းရန်၊ append() နည်းလမ်းကို အသုံးပြုပါ။
အထားအသို
$(selector).prepend(content,function(index,html))
Parameter | Description |
---|---|
content | Required. Specifies the content to insert (can contain HTML tags)
Possible values:
|
function(index,html) | Optional. Specifies a function that returns the content to insert
|
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
ဖြင့် အကြောင်းအရာကို prepend() နည်းလမ်းဖြင့် ဖန်တီးပါ။
ရွေးချယ်ထားသောဒြပ်စင်များ၏အစတွင် အကြောင်းအရာထည့်သွင်းရန် လုပ်ဆောင်ချက်တစ်ခုကို အသုံးပြုခြင်းဖြင့်
❮ jQuery HTML/CSS နည်းလမ်းများ