<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#btn').click(function () {
//form里面被禁用的元素
//$('form :disabled').css('backgroundColor', 'red');
//被禁用的表单
//$('form:disabled').css('backgroundColor', 'red');
//被选中的元素 IE才有效
$('input:checked').css('backgroundColor', 'red');
})
})
</script>
</head>
<body>
<input type="button" name="name" value="显示效果" id="btn"/>
<div>
<input type="checkbox" name="name" value="" checked="checked" />吃饭
<input type="checkbox" name="name" value="" checked="checked" />睡觉
<input type="checkbox" name="name" value="" />打豆豆
</div>
<form action="/" method="post" id="fm1">
<input type="button" name="name" value="按钮" disabled="disabled" />
</form>
<form action="/" method="post" id="fm2">
<input type="text" name="name" value="" />
</form>
</body>
</html>