document.getElementById('photoText').href;

解决方案 »

  1.   

    to cvpc(一回) 刚用了 没有用哦
      

  2.   

    <a  id="photoText"  href="#"  target=_blank>str</a>
    <script type="text/javascript">
    alert(document.getElementById('photoText').href);
    </script>
      

  3.   

    怎么没有用,你的例子中href是空的啊。
    如果是单前页面,你就写当前页面的绝对路径。
      

  4.   

    document.getElementById('photoText').getAttribute('href')