English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
O método removeAttr () remove um ou mais atributos do elemento selecionado.
Para obter ou definir atributos HTML, useattr ()Método.
$ (selector).removeAttr (attribute)
Excluir o atributo estilo de todos os parágrafos:
$("button").click(function(){ $("p").removeAttr("style"); });Teste e Veja‹/›
Excluir o atributo href de todos os links de hipertexto:
$("button").click(function(){ $("a").removeAttr("href"); });Teste e Veja‹/›
Excluir múltiplos atributos:
$("button").click(function(){ $("p").removeAttr("id class title"); });Teste e Veja‹/›
Parâmetro | Descrição |
---|---|
attribute | Especificar um ou mais (separados por espaço) atributos a serem excluídos |