🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.alert.dismiss()
  2. B.alert.accept()
  3. C.alert.close()
  4. 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 →