Home >Web Front-end >HTML Tutorial >What is the use of the output tag in html5?
In W3C, he uses an output tag, but there is nothing after it. Then onforminput is the event that occurs when the form obtains and fills in the data. What does the form obtain the data? When does it obtain the data, the Javascript event called will assign the value to the output. But the output cannot be output. How can I output it to this tag?
<!DOCTYPE HTML> <html> <head> <script type="text/javascript"> function resCalc() { numA=document.getElementById("num_a").value; numB=document.getElementById("num_b").value; document.getElementById("result").value=Number(numA)+Number(numB); } </script> </head> <body> <p>使用 output 元素的简易计算器:</p> <form onsubmit="return false"> <input id="num_a" /> + <input id="num_b" /> = <output id="result" onforminput="resCalc()"></output> </form> </body> </html>
Result;
##html5 has output and onforminput, but the browser does not support it. You must know that not all browsers implement the html5 standard, only Opera 10 is supported. I originally wanted to take a screenshot for you to see, but it seems that it cannot be uploaded. Then you can refer to the "The Authoritative Guide to HTML.5 and CSS.3", which mentions theand then add oninput="resCalc()" in
The above is the detailed content of What is the use of the output tag in html5?. For more information, please follow other related articles on the PHP Chinese website!