如何在一个变量内找到多个类?jQuery

How to find multiple classes within a variable? jQuery

本文关键字:jQuery 一个 变量      更新时间:2023-09-26

我的建议如下:

    var myForm = $("#my-form");
    var myElements = myForm.find(".first-class .second-class");

我做错了什么?

由于元素位于my-form元素内部,因此可以发现它们之间用逗号,分隔。示例:

var myElements = myForm.find(".first-class, .second-class");