【发布时间】:2016-09-22 22:12:42
【问题描述】:
I used the following line to do so, but it fails when a select comes on the form.它离开了选择,然后即使输入也停止工作。
var $ele = $("select,input[type='text'],input[type='password']:visible[required]").filter(function ()
{ return this.value.trim() == '' || this.value.trim().indexOf('--') != -1 ;
}).eq(0);
【问题讨论】:
-
$('form').find('input[type=text]:first,select:first')或$('form').find('input[type=text],select').first()
标签: jquery