Run javascript on a specific execution context

enter image description hereI am trying to write a javascript that renames the text of a button on a website.

`setInterval(function() {

    let Bestellbutton2 = document.getElementsByClassName("_7tbHf _3LH_L");
   
    Bestellbutton2[0].innerHTML = "Anfrage absenden";}, 500);`

The problem I’m having seems to be the execution context. This code only works if I inspect the element first, or if I manually change the execution context from above to the selected one (checkout).

How can I solve this problem?

This code works only if i inspect element first, or if manually change execution context form top to the one selected (chekcout).