1 line
1.6 KiB
JSON
1 line
1.6 KiB
JSON
{"name":"enabled","type":"selector","title":":enabled Selector","deprecated":null,"removed":null,"desc":"Selects all elements that are enabled.","categories":["selectors/form-selectors","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Find all input elements that are enabled.","code":"\n$( \"input:enabled\" ).val( \"this is it\" );\n","html":"\n<form>\n <input name=\"email\" disabled=\"disabled\">\n <input name=\"id\">\n</form>\n"},"longdesc":"\n <p>As with other pseudo-class selectors (those that begin with a \":\") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ( \"*\" ) is implied. In other words, the bare <code>$( \":enabled\" )</code> is equivalent to <code>$( \"*:enabled\" )</code>, so <code>$( \"input:enabled\" )</code> or similar should be used instead. </p>\n\n <p>Although their resulting selections are usually the same, <code>:enabled</code> selector is subtly different from <code>:not([disabled])</code>; <code>:enabled</code> selects elements that have their boolean disabled property strictly equal to false, while <code>:not([disabled])</code> selects elements that do not have a disabled <em>attribute</em> set (regardless of its value).</p>\n\n <p>The <code>:enabled</code> selector should only be used for selecting HTML elements that support the <code>disabled</code> attribute (<code><button></code>, <code><input></code>, <code><optgroup></code>, <code><option></code>, <code><select></code>, and <code><textarea></code>).</p>\n\n "}],"slug":"enabled-selector"} |