【问题标题】:How to pass value from html to url using jstl ,href="edittheme?id=value1"如何使用 jstl 将值从 html 传递到 url ,href="edittheme?id=value1"
【发布时间】:2015-01-06 06:10:50
【问题描述】:
<input type="text" name="value1" id="value1"/>

<a href="edittheme?id=value1" title="Edit Event">Edit</a></td>

value1 是使用脚本设置的

document.getElementById("value1").value = themeId;          

谁能帮忙。

【问题讨论】:

    标签: javascript html jstl


    【解决方案1】:

    您需要使用 JavaScript 选择&lt;a&gt;,然后更改href 属性:

    JS

    var value = document.getElementById("value1").value;
    document.getElementById("linkEdit").href = 'edittheme?id=' + value;
    

    HTML

    <a href="" id="linkEdit" title="Edit Event">Edit</a>
    

    【讨论】:

    • 谢谢。这解决了我的问题。如果需要,如何从输入框中传递值?
    • 有没有办法传递输入框值。
    猜你喜欢
    • 2014-02-12
    • 1970-01-01
    • 1970-01-01
    • 2015-10-03
    • 2012-08-04
    • 2016-03-09
    • 2016-09-11
    • 1970-01-01
    相关资源
    最近更新 更多