标题:新手学DOM的一些问题
取消只看楼主
liuhong2099
Rank: 2
等 级:论坛游民
帖 子:2
专家分:20
注 册:2009-9-1
结帖率:100%
已结贴  问题点数:20 回复次数:0 
新手学DOM的一些问题
<body onload="onlod();">
  <h1>Snapshots</h1>
  <ul id="imagegallery">
    <li>
      <a href="images/fireworks.jpg" title="A fireworks display">
        <img src="images/thumbnail_fireworks.jpg" alt="Fireworks" />
      </a>
    </li>
    <li>
      <a href="images/coffee.jpg" title="A cup of black coffee" >
        <img src="images/thumbnail_coffee.jpg" alt="Coffee" />
      </a>
    </li>
    <li>
      <a href="images/rose.jpg" title="A red, red rose">
        <img src="images/thumbnail_rose.jpg" alt="Rose" />
      </a>
    </li>
    <li>
      <a href="images/bigben.jpg" title="The famous clock">
        <img src="images/thumbnail_bigben.jpg" alt="Big Ben" />
      </a>
    </li>
  </ul>
  <img id="placeholder" src="images/placeholder.gif" alt="my image gallery" />
  <p id="description">Choose an image.</p>
</body>
我的js代码    <script>
      function onlod(){
          var ids = document.getElementById("imagegallery");
          var a = ids.getElementsByTagName("*");
        alert(a);
      
      }
    </script> 请问我想取出 <a href 里的 title 怎么取出来啊


搜索更多相关主题的帖子: DOM 
2009-09-02 00:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-284469-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.111961 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved