From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../pl/web/api/document/createattribute/index.html | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 files/pl/web/api/document/createattribute/index.html (limited to 'files/pl/web/api/document/createattribute') diff --git a/files/pl/web/api/document/createattribute/index.html b/files/pl/web/api/document/createattribute/index.html new file mode 100644 index 0000000000..ad996d5161 --- /dev/null +++ b/files/pl/web/api/document/createattribute/index.html @@ -0,0 +1,29 @@ +--- +title: document.createAttribute +slug: Web/API/Document/createAttribute +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/createAttribute +--- +

{{ ApiRef() }}

+

Podsumowanie

+

createAttribute tworzy nowy atrybut w bieżącym elemencie.

+

Składnia

+
atrybut = element.createAttribute(nazwa)
+
+

Parametry

+ +

Przykład

+
d = document.getElementById("div1");
+p = d.createAttribute("proportion");
+p.value = "100";
+
+

Uwagi

+

Zwracany jest węzeł typu Attribute. Kiedy masz już ten węzeł, tak jak w powyzszym przykładzie, możesz ustawić jego wartość za pomocą własności value. DOM nie wymusza typu atrybutów, jakie mogą zostać dodane w ten sposób do konkretnych elementów.

+

Specyfikacja

+

createAttribute

+

{{ languages( { "en": "en/DOM/document.createAttribute", "fr": "fr/DOM/document.createAttribute" } ) }}

-- cgit v1.2.3-54-g00ecf