So, I am writing a script that can be run on the page, but I want to click on this element, unfortunately, it does not have an id , and I'm trying to use the .click() function on it, but it will not work, thatβs what I have, Does anyone know how to fix this? This is the only element in the class as well.
var classes = document.getElementsByClassName('rateRecipe btns-one-small'); var Rate = classes[0]; Rate.click();
source share