-1

Trying to enter the password text from browser console using value() of Javascript,but the password is not getting entered in textBox.

document.getElementsByClassName('whsOnd').value='test`

Attaching the screenshotenter image description here

Posting Answer so that it may help someone in future who visits here for an answer.

As said by @Amit kumar below in accepted answer,it returns an array so we need to add index to it ,

document.getElementsByClassName('whsOnd')[0].value='test`

Blue Star
  • 55
  • 6

1 Answers1

1

getElementsByClassName give an array so use iteration or indexing on that.

Amit kumar
  • 457
  • 6
  • 14