← Quiz: Web Elements: all 10 questions
Quiz: Web Elements · Question 9 of 10
Which call cancels a JavaScript confirm dialog?
Which call cancels a JavaScript confirm dialog?
- A.alert.accept()
- B.alert.dismiss()
- C.alert.getText()
- D.driver.close()
Answer & explanation
Correct answer: alert.dismiss()
accept presses OK; 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 →