JQuery Selector Enabled

From CoderLearner
Jump to: navigation, search

Description

Select all elements are enabled.

Syntax

$('input:enabled');

Example 1

<!DOCTYPE html>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Select</title>
      <script 
         type="text/javascript" 
         src="/lib/jquery-1.7.2.min.js">				 
      </script>

      <script>
         $().ready(function() {
            $('form input:enabled').val('Please enter something');
         });
      </script>
   </head>
   <body> 
      <form>
         <input type="text" name="fname"/><br/>
         <input type="text" name="middle" disabled="disabled"/><br/>
         <input type="text" name="lname"/><br/>
      </form>
   </body>
</html>

Try It