I am trying to make an auto click on a certain button `y until Success appears on the page.
if(!$( "div:contains('Успех')" ).length) { $('button').click(); } <button class="btn btn-danger btn-lg btn-block betButton" data-lower="1" data-upper="7">1 to 7</button> <button class="btn btn-success btn-lg btn-block betButton" data-lower="0" data-upper="0">0</button> <button class="btn btn-inverse btn-lg btn-block betButton" data-lower="8" data-upper="14">8 to 14</button> I wanted to do this in the form of a time slot but he even after the appearance of the inscription will check the page for the word How can this be done differently? And besides, I can not figure out how to distinguish the buttons from each other, that would not click on everything at once but on one if there are a lot of them.