不行啊!
我的JS代码是:
document.getElementById('tb').value+=document.getElementsByTagName("a")[i].href;
需要加在哪???

解决方案 »

  1.   

    document.getElementById('tb').value+=document.getElementsByTagName("a")[i].href+"\n";
      

  2.   

    http://localhost:1043/WebSite2/Default.aspxhttp://localhost:1043/WebSite2/TextLink.aspxhttp://localhost:1043/WebSite2/Default2.aspxhttp://localhost:1043/WebSite2/Default3.aspx
    这个如果你是字符串在C#里面给js的
    那么
    string js = "http://localhost:1043/WebSite2/Default.aspx\\r\\nhttp://localhost:1043/WebSite2/TextLink.aspx\\r\\nhttp://localhost:1043/WebSite2/Default2.aspx\\r\\nhttp://localhost:1043/WebSite2/Default3.aspx"
      

  3.   

    不是的
    这个值是从HTML中获得的:
    http://localhost:1043/WebSite2/Default.aspxhttp://localhost:1043/WebSite2/TextLink.aspxhttp://localhost:1043/WebSite2/Default2.aspxhttp://localhost:1043/WebSite2/Default3.aspx
    需要传给服务器的 <asp:TextBox >控件,并显示出来!
    就出现了这中情况http://localhost:1043/WebSite2/Default.aspxhttp://localhost:1043/WebSite2/TextLink.aspxhttp://localhost:1043/WebSite2/Default2.aspxhttp://localhost:1043/WebSite2/Default3.aspx
      

  4.   

    document.getElementById('tb').value+=document.getElementsByTagName("a")[i].href+"\r\n";
    汗 早说textbox里面
    加上一个属性
    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

  5.   

    TextMode="MultiLine 它有啥用啊???