Select all the enabled from elements:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
src="lib/jquery/jquery-1.3.2.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
$(":enabled").css("background-color", "red");
});
</script>
</head>
<body>
<form action="">
Name: <input type="text" name="user" />
<br/>
ID:<input type="text" name="id" disabled="disabled"
/> Age:
<select disabled="disabled">
<option>20-30</option>
<option>30-50</option>
<option>50+</option>
</select>
<input type="submit" value="submit"/>
</form>
</body>
</html>
Comments
Post a Comment