js input赋值
用js给文本框赋值
document.getElementById('ID').value = “赋给的值”
用js设置文本框为只读
document.getElementById('ID').readOnly = true ;
项目中,例子如下:
if ($('input[name=installcompcom]').val() == "" && $('input[name=installcomptime]').val() == "") { document.getElementById("installcompcom").value = "同意"; document.getElementById("installcomptime").value ="<?php echo reset(explode(" ",$datalist['createdatetime'])) ;?>"; }