jQuery clone() နည်းလမ်း
❮ jQuery HTML/CSS နည်းလမ်းများ
ဥပမာ
<p> ဒြပ်စင်အားလုံးကို ပွားပြီး <body> ဒြပ်စင်၏ အဆုံးတွင် ၎င်းတို့ကို ထည့်သွင်းပါ-
$("button").click(function(){
$("p").clone().appendTo("body");
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
clone() နည်းလမ်းသည် ကလေး nodeများ၊ စာသားနှင့် attribute များအပါအဝင် ရွေးချယ်ထားသော ဒြပ်စင်များကို မိတ္တူပြုလုပ်သည်။
အထားအသို
$(selector).clone(true|false)
Parameter | Description |
---|---|
true | Specifies that event handlers also should be copied |
false | Default. Specifies that event handlers should not be copied |
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
clone() method ကိုအသုံးပြုနည်း၊ event handlers အပါအဝင် element တစ်ခုကို ကူးယူပါ။
❮ jQuery HTML/CSS နည်းလမ်းများ