


Example analysis of using output tag to mark JavaScript return value
Jul 03, 2017 am 10:35 AMSometimes some data information on the page is filled in after calculation through js. In the past, developers would often treat the <span>
element as a placeholder and specify an ID attribute so that the JavaScript code could Find it and fill in the data. In
HTML5, it is recommended to use <output>
as a placeholder to make the semantics clearer. The actual usage is the same as the previous <span>
of.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>随机数生成</title> <script> function run(){ var resultElement = document.getElementById("result"); resultElement.value = Math.random(); } </script> </head> <body> <p>随机数:<output id="result"></output></p> <input type="button" value="生成" onclick="run()"> </body> </html>
The above is the detailed content of Example analysis of using output tag to mark JavaScript return value. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

Recommended: Excellent JS open source face detection and recognition project

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts

How to use JavaScript and WebSocket to implement a real-time online ordering system

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

Simple JavaScript Tutorial: How to Get HTTP Status Code
