How to properly access an object using JS with such a set of classes?
-
If the CSS of the object is written like this:
.t744 .t-product__option-select { width: 100%; }
What is the correct way to access this object in JS?
If we have classes separated by a space, not a comma:
.t744 .t-product__option-select
JavaScript Conor Ellison, Oct 22, 2019 -
document.querySelector('.t744 .t-product__option-select');
Anonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!