HTMLOutputElement: name property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ApiRef("HTML DOM")}}

The **name** property of the {{domxref("HTMLOutputElement")}} interface indicates the name of the {{HTMLElement("output")}} element. It reflects the element's [name](/en-US/docs/Web/HTML/Reference/Elements/output#name) attribute.

Value

A string representing the element's name.

Example

js
const outputElement = document.querySelector("#log");
console.log(`Element's name: ${outputElement.name}`);
outputElement.name = "sum"; // sets or updates the element's name

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLOutputElement.defaultValue")}}
  • {{domxref("HTMLOutputElement.htmlFor")}}
  • {{domxref("HTMLOutputElement.labels")}}