设置input的只读属性

input.readOnly = "true";

 input.setAttribute("readOnly","true");

http://azhp.blog.163.com/blog/static/47736718200871995313811/

你可能感兴趣的:(HTML)