← Quiz: Web Elements: all 10 questions
Quiz: Web Elements · Question 2 of 10
How do you press OK on a JavaScript alert?
How do you press OK on a JavaScript alert?
- A.alert.dismiss()
- B.alert.accept()
- C.alert.close()
- D.driver.quit()
Answer & explanation
Correct answer: alert.accept()
dismiss() presses Cancel.
Can you get the rest right without peeking?
Take the timed Quiz: Web Elements quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →