2010-06-07 11 views
14

मुझे निम्नलिखित मिल गए हैं जो सभी बटनों को छोड़ देंगे, लेकिन मैं छिपे हुए फ़ील्ड को कैसे बाहर निकाल सकता हूं?मैं jquery के साथ बटन और छिपे हुए फ़ील्ड को छोड़कर सभी इनपुट कैसे प्राप्त कर सकता हूं?

$("#selector").find(":input:not(:button)").each(function (i) { // do something 

मुझे यकीन है कि यह शायद आसान है कर रहा हूँ, मैं सिर्फ यह नहीं मिल रहा।

बहुत धन्यवाद!

उत्तर

37

निम्नलिखित कोड यह करना चाहिए ..

$('#selector :input').not(':button,:hidden').each(...); 
+0

धन्यवाद, कि आवश्यकतानुसार काम किया! –

3
$('#selector').find('input').not(':button').not('input[type=hidden]').each(function(i) { 
}); 

इसे करना चाहिए। मुझे यकीन है कि अगर यह एक

$('#selector').find('input').not(':button').not(':hidden').each(function(i) { 
}); 

भी उस उद्देश्य के लिए काम करता है, लेकिन एक कोशिश अपने लायक नहीं हूँ।

4
$("#selector :input:not(:button, :hidden)").each(function (i) { // do something 
0

मेरे लिए, (jQuery 2.2.0)

काम नहीं किया

$('#signup-form :input:not(:hidden :button)').each(function(){ 
$('#signup-form :input').not(':hidden :button').each(function(){ 
$('#signup-form *').filter(':input:not([type=hidden][type=button])').each(function(){ 

DID

$('#signup-form *').filter(':input').not(':button').not('input[type=hidden]').each(function(){ 

या

$('#signup-form :input').not(':hidden').not(':button').each(function(){ 
संबंधित मुद्दे