:input 选择器返回按钮但 :not([type=button]) 不起作用

:input selector returning button but :not([type=button]) doesn't work

我正在组合 select 或 select 我的 html 中的特定输入:

$('.content_container :input[type=radio]:checked, .content_container :input:not([type=radio])')

问题在于它还 returns <button type='button'>

我尝试添加以下内容:

.content_container :input:not([type=button])
.content_container :button:not([type=button])

我的 select 或者,但它仍然是 returns 按钮。我该如何安排?

您需要将这两种类型合并为一个 :not()

.content_container :input:not([type=radio],[type=button])

否则,带有 :not([type=radio]) returns 所有其他类型输入的选择器,包括按钮,以及带有 :not([type=button]) returns 所有其他输入的选择器,包括收音机,所以当您将它们组合在一起时,您会同时获得收音机和按钮,而不是同时排除两者。