control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/checkbox-selector.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
1.7 KiB
JSON

{"name":"checkbox","type":"selector","title":":checkbox Selector","deprecated":null,"removed":null,"desc":"Selects all elements of type checkbox.","categories":["selectors/form-selectors","selectors/jquery-selector-extensions","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Finds all checkbox inputs.","code":"\nvar input = $( \"form input:checkbox\" )\n .wrap( \"<span></span>\" )\n .parent()\n .css({\n background: \"yellow\",\n border: \"3px red solid\"\n });\n\n$( \"div\" )\n .text( \"For this type jQuery found \" + input.length + \".\" )\n .css( \"color\", \"red\" );\n\n// Prevent the form from submitting\n$( \"form\" ).submit(function( event ) {\n event.preventDefault();\n});\n","css":"\n textarea {\n height: 25px;\n }\n","html":"\n<form>\n <input type=\"button\" value=\"Input Button\">\n <input type=\"checkbox\">\n\n <input type=\"checkbox\">\n <input type=\"file\">\n <input type=\"hidden\">\n\n <input type=\"image\">\n <input type=\"password\">\n <input type=\"radio\">\n\n <input type=\"reset\">\n <input type=\"submit\">\n <input type=\"text\">\n\n <select>\n <option>Option</option>\n </select>\n\n <textarea></textarea>\n <button>Button</button>\n</form>\n\n<div></div>\n"},"longdesc":"\n <p><code>$( \":checkbox\" )</code> is equivalent to <code>$( \"[type=checkbox]\" )</code>. 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>$(':checkbox')</code> is equivalent to <code>$( \"*:checkbox\" )</code>, so <code>$( \"input:checkbox\" )</code> should be used instead. </p>\n "}],"slug":"checkbox-selector"}