Home >>jQuery Tutorial >jQuery enabled Selector

jQuery enabled Selector

jQuery enabled Selector

jQuery enabled selector in jQuery is used to selects all enabled form elements.

Syntax:
$(":enabled")
Here is an Example of jQuery :enabled Selector

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(":enabled").css("background-color","#c0ed1f");
});
</script>
</head>
<body>
<form action="">
Name: <input type="text" name="user"><br><br>
ID:<input type="text" name="id" disabled="disabled"><br><br>
Age:
<select disabled="disabled">
<option>33-40</option>
<option>40-50</option>
<option>50+</option>
</select><br><br>
<input type="submit">
</form>
</body>
</html>

Output:
Name:

ID:

Age: