Many times with textboxes you can use the selector of "input[type=text]" in the stylesheet or jQuery. Now with all the new textbox variations in HTML5, how can you deal with textboxes besides listing them all out like this?:
input[type=text], input[type=color], input[type=datetime], input[type=email], input[type=number], input[type=search], input[type=tel], input[type=url],...
As far as I know there is no selector that selects those inputs, you can define a custom selector.
var types = ['button', 'submit', 'reset', 'hidden', 'checkbox', 'radio'];
jQuery.extend(jQuery.expr[':'], {
textbox: function (elem) {
return jQuery.inArray(elem.type, types) === -1
}
});
$('input:textbox').bar();
http://jsfiddle.net/Xryyq/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With