这是一个快速提问,选择jquery输入
我需要按类型和按名称选择jquery元素。
我知道,我们可以这样做:
$('.form-control input[type=text]')....
但我需要的名字也选择..
你有另一种方式,除非用做:
$('.form-control input[type=text]').each(function(){
if($(this).attr('name') == 'search'){
// this is my selector
}
}
谢谢