语法:

E:enabled : {attribute}

相关伪类E:disabled | E:checked | E::selection

说明:

匹配所有用户界面(form表单)中处于可用状态的E元素

兼容性:

类型 IEInternet Explorer FirefoxFirefox ChromeChrome OperaOpera SafariSafari
版本 (×)IE6 (√)Firefox 2.0 (√)Chrome 1.0.x (√)Opera 9.63 (√)Safari 3.1
(×)IE7 (√)Firefox 3.0 (√)Chrome 2.0.x (√)Safari 4Public beta
(×)IE8

示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
input:enabled {background-color:#FF0000;}
</style>
<title>UI元素状态伪类 E:enabled</title>
</head>

<body>
<div style="width:733px; border: 1px solid #666; padding:5px;">
<form method="post" action="">
	<input type="text" value="默认状态下的表单都是enabled" />
</form>
</div>
</body>
</html>
 

快速跳转