Skip to content
CodeKruPro

Reading the text of a hidden element

QuizEasy-Medium

An input is hidden with display:none (a style that removes it from view) and has value="secret". What do the visible text and the value attribute give?

  • Text is an empty string; the value attribute is secret
  • Text is secret; the value attribute is empty
  • Both throw ElementNotInteractableException
  • Both throw NoSuchElementException

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in