用js给html控件赋值

时间:2021-10-24 19:30:33
 

  用js给html控件赋值

<script>
window.onload=function setValue()//在页面加载时赋值
{
document.getElementById("你要赋值的控件ID").value=你需要赋的值;
            //$("#aa").html('给html赋值');
            //document.getElementById('aa').innerText='给html赋值';
            //document.getElementById('aa').innerHTML='给html赋值';
}
</script>