用js给html控件赋值

 

  用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>

 

posted @ 2016-10-24 18:55  GL_BKY  阅读(7374)  评论(1编辑  收藏  举报