I have a Firefox extension that clicks something, and the code responsible for the actual click is this:
function xxBtn(){
var btn = document.querySelector('button.ooo-qqq-vvv')
if( !btn ){ return }
btn.click()
}
The code it's clicking on is this:
<button class="ooo-qqq-vvv zzz-ttt" aria-label="One (k)" title="One (p)">
How can I make it so that it only clicks if BOTH the "class" and "title" elements are true?
So let's say we have these three on the page:
<button class="ooo-qqq-vvv zzz-ttt" aria-label="One (k)" title="One (p)">
<button class="ooo-qqq-vvv zzz-ttt" aria-label="One (k)" title="Two (p)">
<button class="ooo-qqq-vvv zzz-ttt" aria-label="One (k)" title="Three (p)">
I only want the click to happen on the first one. So I need both the class and title to be true for a click to occur. The way it works right now is it clicks by class, and it will click all of them.
Thanks