HTML 5 introduced a new element <output> which is used to represent the result of different types of output, such as output written by a script.HTML 5 offers<output> tag which is used to dynamically show result of a JavaScript function .

<head>
    <script type="text/javascript">
 
        function changefont() {
            document.getElementById("result").value = document.forms[0].text.value.toUpperCase(); //retrieving textbox value and changing font size in upper case
        }
    </script>
</head>
<body>
    <form id="form1">
    <p>
        Example of output element:</p>
    <input id="text" />
    <label id="l1">
    </label>
    <output id="result" onforminput="changefont()"></output>
    <!--output element is used to show dynamically result of a javascript function  depending on the input-->
    </form>
</body>

If I will write any text in the textbox all text of textbox will convert in upper case as shown below:

Screenshot

HTML 5 Output Element

Browser Support

Attribute

Firefox

IE

Opera

Chrome

Safari

output

No

No

10.5

3.0

No

 

Leave Comment