Sunil Chaudhry Sunil Chaudhry - 8 months ago 74
jQuery Question

how to find first input/select in jquery

I used the following line to do so, but it fails when a select comes on the form. It lefts select and then it stops working even for inputs.

var $ele = $("select,input[type='text'],input[type='password']:visible[required]").filter(function ()
{ return this.value.trim() == '' || this.value.trim().indexOf('--') != -1 ;


You may looking for below code.