Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. let timerId = setInterval(function () {
  2. if (document.getElementById('some-id') != null) {
  3. var element = document.getElementById('some-id');
  4. var event = new Event('input');
  5. element.value = "322";
  6. element.dispatchEvent(event);
  7. clearInterval(timerId);
  8. }
  9. }, 250)
  10.  
  11. function waitForSubmitButton() {
  12. let timerId = setInterval(function () {
  13. if (document.getElementsByClassName('button-submit')[0] != undefined) {
  14. console.log('button is ready');
  15. console.log(document.getElementsByClassName('button-submit')[0]);
  16. document.getElementsByClassName('button-submit')[0].click();
  17. clearInterval(timerId);
  18. }
  19. else
  20. console.log(document) // возвращает document айфрейма
  21. }, 250)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement