怎样在html中的href属性使用javascript变量?

如题所述

<a href="#" onclick="location.href=url_search;"> //这样会是当前页面打开
可以给a一个id
<a href="#" id="url">

<script>
document.getElementById("url").href = url_search;

</script>
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答