2011-09-13 101 views

回答

4

对于<canvas>元素就这样你可以把内容将被显示的浏览器不支持该元素尚未:

<canvas id="example" width="200" height="200"> 
This text is displayed if your browser does not support HTML5 Canvas. 
</canvas> 

对于<progress>元素,它可以让你控制的进程的显示文本:

<section> 
<h2>Task Progress</h2> 
<p>Progress: <progress id="p" max=100><span>0</span>%</progress></p> 
<script> 
    var progressBar = document.getElementById('p'); 
    function updateProgress(newValue) { 
    progressBar.value = newValue; 
    progressBar.getElementsByTagName('span')[0].textContent = newValue; 
    } 
</script> 
</section> 
+0

这个我知道,我想知道如果是这样 –

+1

您可以了解更多有关从[WHATWG规范页]这些元素只是因为(http://www.whatwg.org/specs/网络应用/电流工作/)。 –