Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The HTMLOutputElement() constructor creates a new HTMLOutputElement object.
Note: Currently only Safari implements this constructor, so using Document.createElement() is recommended for broader compatibility — see the example below.
None.
A new HTMLOutputElement object.
Thrown with the message "Illegal constructor" in browsers that do not support this constructor.
Note: In practice, you would usually create <output> elements using Document.createElement() instead of this constructor, since createElement() is supported across all browsers.
This example creates an <output> element using the HTMLOutputElement() constructor and inserts it into a form that adds two numbers together.
| HTML # htmloutputelement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Mar 23, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.