<a href=javascript:void(0) class=PrmryBtnMed
id = VERYLONGTEXT
onclick=$(this).parents('form').submit(); return false;><span>Dispatch to this address</span></a>
I have been using
var inPage = document.documentElement.innerHTML.indexOf('text to search') > 0,
el = document.querySelector(.PrmryBtnMed);
if (inPage && el) el.click();
But now, the class name has changed: there’s a space and some new text in the class name:
<a href=javascript:void(0) class=PrmryBtnMed ApricotWheat
id = VERYLONGTEXT
onclick=ApricotWheat(this); return false;><span>Dispatch to this address</span></a>
How can I change el = document.querySelector(.PrmryBtnMed);
to find the right class?
I tried using el = document.querySelector(.PrmryBtnMed.ApricotWheat);
but that didn’t work.
Next, I tried to add a space (and escape using a backslash): el = document.querySelector(.PrmryBtnMed ApricotWheat);
but that didn’t work either.
So, I wondered if I could use %20
for the space.. but no luck.
I’d be very grateful for some help! What am I doing wrong?