jQuery removeAttr() နည်းလမ်း
❮ jQuery HTML/CSS နည်းလမ်းများ
ဥပမာ
<p> ဒြပ်စင်များအားလုံးမှ style attribute ကို ဖယ်ရှားပါ-
$("button").click(function(){
$("p").removeAttr("style");
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
removeAttr() နည်းလမ်းသည် ရွေးချယ်ထားသော ဒြပ်စင်များမှ တစ်ခု သို့မဟုတ် တစ်ခုထက်ပိုသော အရည်အချင်းများကို ဖယ်ရှားသည်။
အထားအသို
$(selector).removeAttr(attribute)
Parameter | Description |
---|---|
attribute | Required. Specifies one or more attributes to remove. To remove several attributes, separate the attribute names with a space |
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
id နှင့် class attribute ကို ဖယ်ရှားနည်း။
❮ jQuery HTML/CSS နည်းလမ်းများ