2010-06-27 43 views

回答

54
$("#myform :input:not(:checkbox):not(:button)"); 
+2

我*愛* jQuery - 它非常直觀! – morpheous 2010-06-27 22:51:01

+1

是否應該添加[type =「submit」]不是問題的一部分還是[type =「image」]? – FelipeAls 2010-06-27 22:51:26

6

可以使用:not()組合以:checkbox:button選擇器:

$("#myform :input:not(:button):not(:checkbox)"); 

並用成功與的文檔中提供的example測試:輸入

編輯::input還選擇textareaselect,buttoninput[type="hidden"]根據documentation(和有用例如)

+0

你剛剛打敗了我......還有一點點清潔劑 – 2010-06-27 22:48:50

相關問題