I have few divs that contain two classes such as this:
<div class="dateNumbers"></div>
<div class="dateNumbers {{month.year + '-' + month.monthName + '-' + 'end'}}"></div>
<div class="dateNumbers {{month.year + '-' + month.monthName + '-' + 'end'}}"></div>
<div class="dateNumbers {{month.year + '-' + month.monthName + '-' + 'end'}}"></div>
where {{month.year + '-' + month.monthName + '-' + 'end'}}
for a certain month is 2018-August-end
I want to select the divs that contain only 2018-August-end
which I store into a variable so I tried something like this
var dataName = `2018-August-end`; // this is dynamic but for this example I have it static
document.querySelectorAll( "." + dataName);
but I get this error
Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '.2018-August-end' is not a valid selector. at :1:10
why is that ?
Thanks