<html>
<head>
<title>获取HTML文件的指定元素</title>
<script language="JavaScript">
function getElement1(){
   alert(document.all("myH2").tagName);
}
function getElement2(){
   alert(myH2.tagName);
}
function showTags(){
   alert(document.all.tags("P").length);
}
function showItems(){
   var strTags = "";
   for (var i=0; i<document.all["myTag"].length; i++){
      objEle = document.all("myTag").item(i);
      strTags += objEle.tagName + " ";
   }
   alert(strTags);
}
</script>
</head>
<body >
</form>
</body>
</html>


 

相关文章:

  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案