Yes, you can select elements that have multiple classes using querySelector by combining class selectors. To do this, you simply concatenate the class names with a dot (.) without any spaces.
For example, if you want to select an element that has both class1 and class2, you would write:
const element = document.querySelector(".class1.class2");
This will select the first element that has both classes.
If you want to select all elements that have both classes, you can use querySelectorAll:
const elements = document.querySelectorAll(".class1.class2");
This will return a NodeList of all elements that have both class1 and class2.
Remember that the classes must be present on the same element for this to work. If you want to select elements that have either class, you would need to use a comma to separate the selectors:
const elements = document.querySelectorAll(".class1, .class2");
This will select all elements that have either class1 or class2.
