<input name="InputText" type="text" id="InputText" onblur="document.getElementById('aaa').href='a.html?word='+this.value"> <a id="aaa" href="a.html?word=这里怎样动态得到上面文本框的值作为参数啊">谢谢大家帮助 </a>

解决方案 »

  1.   

    <script language="javascript">
    function addParam()
    {
      var objA=document.getElementById("a1");
      objA.href="hehe.html?word="+document.getElementById("InputText").value;
    }
    </script>
    </script>
    <input name="InputText" type="text" id="InputText"> 
    <a id="a1" href="" onclick="addParam()">谢谢大家帮助</a>
      

  2.   

    我做了一个例子,楼上的解释正确。我用了另外的方式。
    注意:超链接的地址页面要存在,不要参数无法传导。
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script>
    function addHrefPara(obj)
    {
    var para = document.getElementById("InputText").value;// 获取文本框中的值
    var href = obj.getAttribute("href");// 获取超链接HREF属性值
    var hrefNew = href + para;
    obj.setAttribute("href",hrefNew);


    }
    </SCRIPT>
    </head><body>
    <input name="InputText" type="text" id="InputText"> <a href="1.html?word=" onclick="addHrefPara(this)" target="_blank">谢谢大家帮助</a></body>
    </html>