Im making a chrome extension that buys automaticly, but sometimes the website is a little slow and it can take some time for the item to load that is has been put in the basket. The "put in basket" button looks like this:
<input type="submit" name="commit" value="add to basket" class="button">And when it is done loading the button change to this:
<input type="submit" name="commit" value="remove" class="button remove">How do i wait for the button to change and then go to check out page? Right now i have this code:
if ($(".button[name=commit]").val() == "remove"){
     window.open("checkout page");
   }  
    