简单教程
提交运行
代码编辑器:
<meta name="keywords" content="HTML, DHTML, CSS, XHTML, JavaScript"> <meta name="description" content="Free Web tutorials"> <meta name="author" content="Hege Refsnes"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <script> function displayResult(){ var x=document.getElementsByTagName("meta"); var txt=""; for (var i=0;i<x.length;i++){ txt=txt + "Content of "+(i+1)+". meta tag: "+x[i].content+"<br>"; } document.getElementById("result").innerHTML=txt; } </script> <button type="button" onclick="displayResult()">显示 Meta 内容</button> <p id="result"></p>
运行结果: