2

我正在尝试做类似的事情:

$(".test").find("button or input[type=button]")

我怎样才能做到这一点?

4

3 回答 3

4

是的,它被称为多重选择器,它是一个逗号:

$(".test").find("button, input[type=button]")

为了完整起见,请注意,:button这正是这样做的,但在几乎所有现代浏览器中都会变慢。

于 2012-05-29T12:37:54.540 回答
3

只需使用逗号即$(".test").find("button, input[type=button]");

于 2012-05-29T12:37:59.630 回答
2
$(".test").find("button, input[type=button]")
于 2012-05-29T12:38:10.937 回答