<script type="text/javascript">
var choice1 = "111";
var choice2 = "222";
</script>
方法一:修改a的href属性
<a id="aaa">查看数据</a>
<script type="text/javascript">
document.getElementById("aaa").href='caxh/down_execgyload?page=1&jgm='+choice1+'&sh='+choice2;
</script>
方法二:用document.write()
<script type="text/javascript">
document.write('<a href=caxh/down_execgyload?page=1&jgm='+choice1+'&sh='+choice2+'>查看数据</a>');
</script>
html向超链接中写入变量
最新推荐文章于 2023-03-03 20:47:59 发布