Why don't use <a> to make the link ???

解决方案 »

  1.   

    <input type="text" value="地址" onclick="window.location=this.value">
      

  2.   

    可能是大家没有理解我所说的,我现在要做的是在文本框加入html语言,但是要在文本框显示的不是html语言,而是解析后的显示效果!比如说<a href="../123.doc">123.doc</a>,我在文本框就显示的是123.doc(超链接的效果),
      

  3.   

    谢谢leohuang(LEO) 的方法,基本上可以实现了!
      

  4.   

    我想知道怎么样才能实现在文本框显示的不是html语言,而是解析后的显示效果!请高手指教!!
      

  5.   

    <textarea id="ice" rows="1" cols="20" style="overflow:auto;cursor:pointer"></textarea>
    <script language="javascript">
    <!--
    a = document.createElement("a");
    a.innerText = "csdn社区";
    a.href = "http://www.csdn.net";
    a.onclick=function(){location.href=this.href};
    ice.appendChild(a);
    //-->
    </script>