From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../ru/web/api/element/removeattribute/index.html | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 files/ru/web/api/element/removeattribute/index.html (limited to 'files/ru/web/api/element/removeattribute/index.html') diff --git a/files/ru/web/api/element/removeattribute/index.html b/files/ru/web/api/element/removeattribute/index.html new file mode 100644 index 0000000000..22bdfb22c2 --- /dev/null +++ b/files/ru/web/api/element/removeattribute/index.html @@ -0,0 +1,36 @@ +--- +title: Element.removeAttribute() +slug: Web/API/Element/removeAttribute +translation_of: Web/API/Element/removeAttribute +--- +

{{ APIRef("DOM") }}

+ +

removeAttribute удаляет аттрибут с элемента.

+ +

Синтаксис

+ +
element.removeAttribute(attrName);
+
+ + + +

Пример

+ +
// <div id="div1" align="left" width="200px">
+document.getElementById("div1").removeAttribute("align");
+// now: <div id="div1" width="200px">
+
+ +

Заметки

+ +

Вы должны использовать removeAttribute вместо того, чтобы устанавливать значение атрибута в null, используя setAttribute.

+ +

Попытка удаления аттрибута, которого нет на элементе не вызывает ошибки.

+ +

{{ DOMAttributeMethods() }}

+ +

Спецификация

+ +

DOM Level 2 Core: removeAttribute (introduced in DOM Level 1 Core)

-- cgit v1.2.3-54-g00ecf