a标签中onclick事件绑定失败
要写一个点击a标签就生成随机数,然后赋给文本框的功能,但是onclick事件绑定失败
这是jsp 代码: <a class="aid" href="javascript:void(0)" id="aid" onclick="text()" >点击生成id</a>
js页码:
function text(){
document.getElementById("o_id").value=Math.round(Math.random() * (100000- 1) + 1);
}