Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

output

The <output> element is used to represent output created during runtime of your applications. If you built a tip slider, the amount to tip the server could render in the output element. Or if you built a chat application, the new messages could be rendered into output elements.

Code Example

<input type="text" name="tf1" onchange="addNums()" size="2"> + <input type="text" name="tf2" onchange="addNums()" size="2"> = <output name="tf_result" for="tf1 tf2"></output> <script> function addNums(){ var num1 = Number(document.getElementsByName("tf1")[0].value); var num2 = Number(document.getElementsByName("tf2")[0].value); document.getElementsByName("tf_result")[0].innerHTML = num1+num2; } </script> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list for - specify inputs that took part in creating the result possible values: "space separated element id list" form - associate the element to a form possible values: "form id" name - specify a name for the element possible values: "string"

Official Documentation

http://www.w3.org/TR/html/forms.html#the-output-element

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr