HTML <output> name Attribute

The name attribute on an <output> tag assigns a name to that output element. The name can be used by JavaScript to reference the output element.

Example

#

A name attribute on an <output> element.
The name is used as a reference in the form oninput event.



The value is 25
<form oninput="result.value = slider.value">
  <input type="range" id="slider" value="25"> 
  <br /><br />
  The value is <output name="result" for="slider">25</output>
</form>

Using name

The name attribute assigns a name to the output element.

This attribute can be used as a reference in JavaScript.


Syntax

<output name="name">

Values

#

Value Description
name String value that represents the output name.

Browser support

Here is when name support started for each browser:

Chrome
10.0 Mar 2011
Firefox
4.0 Mar 2011
IE/Edge
13.0 Nov 2015
Opera
11.5 May 2011
Safari
7.0 Oct 2013

You may also like

 Back to <output>
Guides