Latest web development tutorials

jQuery removeAttr () metode

jQuery HTML Metode / CSS jQuery HTML Metode / CSS

contoh

Lepaskan properti gaya dari semua <p> elemen:

$("button").click(function(){
$("p").removeAttr("style");
});

Coba »

Definisi dan Penggunaan

Metode removeAttr () untuk menghapus satu atau lebih atribut dari elemen yang dipilih.


tatabahasa

$(selector).removeAttr(attribute)

参数 描述
attribute 必需。规定要移除的一个或多个属性。如需移除若干个属性,请使用空格分隔属性名称。


contoh

contoh yang lebih

Hapus beberapa properti dari elemen yang dipilih
Bagaimana Anda menghapus id dan kelas atribut dari elemen yang dipilih.


jQuery HTML Metode / CSS jQuery HTML Metode / CSS