如何用js给html控件赋值

如题所述

document.getElementById("输入框的id").value = xxx;
jquery写法(先引用jquery库),$("#输入框的id").val(xxx);
温馨提示:答案为网友推荐,仅供参考