0

I'm getting a syntax error here for a script I'm working on. Can't exactly catch what it is. How does one make this one liner work?

setTimeout(function(){document.querySelector('#enterButton').click()}, 10000);}, 100);

1 Answer 1

3

Line breaks help see the issue:

setTimeout(function(){
    document.querySelector('#enterButton').click()
}, 10000);}, 100);
        //^^^ wtf is that!?

Only 1 interval needs to be specified:

setTimeout(function(){
    document.querySelector('#enterButton').click()
}, 10000);
Sign up to request clarification or add additional context in comments.

1 Comment

"Line breaks help see the issue" Quite. I almost want to ask the OP, "Do you actively dislike the person who has to maintain this code later?!" :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.