Is there a way that I can write the following selector in a less verbose manner (the parent id repeats over and over).
$("#parent_id .class1 , #parent_id .class2,....")
Thanx!
List your classes in the context of the object as follows:
$('.class1, .class2, .class3', $('#parent_id'))
Edit : jsFiddle example .
$("#parent_id").find(".class1, .class2, .class3").....
I'm not sure if you understand you. You can select multiple elements using jQuery: http://api.jquery.com/multiple-selector/
So, something like $ (". Class1, .class2"); should work.
Source: https://habr.com/ru/post/1394028/More articles:value of the final control variable - javaReading sample column data from a text file to a list in Java - javaProblems with synchronization while checking contents of several text nodes in capybara - ruby ββ| fooobar.comScrollView Ignore OnTouch while scrolling? - androidmultiple problem with UIAlertView - iosHumble View / MVP with WinForms and UserControls Collection - .netDisabling Listbox does not change background color in style - backgroundR colSums By Group - rList of selected list items - templatesRails 3. How to use disable_with in a button tag? - htmlAll Articles