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

1 line
1.5 KiB
JSON

{"name":"button","type":"selector","title":":button Selector","deprecated":null,"removed":null,"desc":"Selects all button elements and elements of type button.","categories":["selectors/form-selectors","selectors/jquery-selector-extensions","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Find all button inputs and mark them.","code":"\nvar input = $( \":button\" ).addClass( \"marked\" );\n$( \"div\" ).text( \"For this type jQuery found \" + input.length + \".\" );\n// Prevent the form from submitting\n$( \"form\" ).submit(function( event ) {\n event.preventDefault();\n});\n","css":"\n textarea {\n height: 35px;\n }\n div {\n color: red;\n }\n fieldset {\n margin: 0;\n padding: 0;\n border-width: 0;\n }\n .marked {\n background-color: yellow;\n border: 3px red solid;\n }\n","html":"\n<form>\n <fieldset>\n <input type=\"button\" value=\"Input Button\">\n <input type=\"checkbox\">\n\n <input type=\"file\">\n <input type=\"hidden\">\n <input type=\"image\">\n\n <input type=\"password\">\n <input type=\"radio\">\n <input type=\"reset\">\n\n <input type=\"submit\">\n <input type=\"text\">\n <select>\n <option>Option</option>\n </select>\n\n <textarea></textarea>\n <button>Button</button>\n </fieldset>\n</form>\n\n<div></div>\n"},"longdesc":"\n <p>An equivalent selector to <code>$( \":button\" )</code> using valid CSS is <code>$( \"button, input[type='button']\" )</code>.</p>\n "}],"slug":"button-selector"}