Home HTML元素禁用的方法
Post
Cancel

HTML元素禁用的方法

禁用radio,设置为只读,不能选定

1
2
<input type="radio" name="gender" value="1" disabled/><span >男</span>
<input type="radio" name="gender" value="0" disabled/><span >女</span> 

禁用input,设置为只读,不能填写

1
<input name="gender" type="text" value="1" readonly/>

禁用select,设置为只读,不能选择

1
2
3
4
5
6
<select id="test" name="sortId" disabled>
   <option value=""></option>
   <option value="1">低</option>
   <option value="2">中</option>
   <option value="3">高</option>
</select>
This post is licensed under CC BY 4.0 by the author.

计算相差的月数

生成随机id