R Reveley R Reveley - 1 year ago 93
jQuery Question

jQuery select multiple types of text based inputs

I'm using a jQuery hack to fix a bug in Chrome that causes alignment problems in empty fields. Chrome align-items: baseline for select and input elements

$('input:text').each(function(i,el) {
if (!el.value || el.value == '') {
el.placeholder = ' ';

I want to affect all text style inputs (text,email,date,tel,number etc) without affecting radios checkboxes and range sliders as it seems a neater way to do it.

Is there a way to do this without listing each input type individually?

Answer Source

Remove type=checkbox and type=radio

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download