Apsed1976 Apsed1976 - 1 year ago 86
Javascript Question

How to find multiple classes within a variable? jQuery

My unsecesfull on doing so is following:

var myForm = $("#my-form");

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

What am I doing wrong?

Answer Source

Since the elements are inside the my-form element, you could find them separated by comma ,. For sample:

var myElements = myForm.find(".first-class, .second-class");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download