1 line
1.6 KiB
JSON
1 line
1.6 KiB
JSON
{"name":"disabled","type":"selector","title":":disabled Selector","deprecated":null,"removed":null,"desc":"Selects all elements that are disabled.","categories":["selectors/form-selectors","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Finds all input elements that are disabled.","code":"\n$( \"input:disabled\" ).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>$(':disabled')</code> is equivalent to <code>$('*:disabled')</code>, so <code>$('input:disabled')</code> or similar should be used instead. </p>\n\n <p>Although their resulting selections are usually the same, the <code>:disabled</code> selector is subtly different from the <code>[disabled]</code> attribute selector; <code>:disabled</code> checks the boolean (true/false) value of the element's disabled property while <code>[disabled]</code> checks for the existence of the disabled attribute.</p>\n\n <p>The <code>:disabled</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":"disabled-selector"} |