系统:win7
1、打开html开发工具,在新建的html代码页面上创建一个input文本框
<足毂忍珩img src="http://exp-picture.cdn.bcebos.com/a007a9b1eef97fbd252dce04b74133bad24133e9.jpg?x-bce-process=image%2Fcrop%2Cx_0%2Cy_0%2Cw_600%2Ch_400%2Fformat%2Cf_auto%2Fquality%2Cq_80" width="600" height="400" data-rotation="0" data-image-height="400" data-image-width="600" data-x="0" data-y="0" data-width="600" data-height="400" />
2、在input文本框上添加readonly="readonly"属性,代码:<input type="text" value="设置只读" readonly="readonly"/>
3、保存html代码页面,然后使用浏览器打开,会发现input文本框无法输入内容,表示设置只读模式成功了。