0

This Website Has one text boxes, There Is no button on that webpage it needs to click the enter button on the keyboard to work.

I successfully entered text into text area :

document.getElementById("lookup-user-username").value="Name  Here";

I need To Press Enter Button Using the chrome Web Console At This movement. Can Anyone Help?

console

Website: website

  • "trigger enter key javascript" – epascarello Oct 04 '21 at 15:04
  • do you really doing web-scraping using chrome developer tool? Other library may have native solutions. – apple apple Oct 04 '21 at 15:07
  • 1
    Does this answer your question? [How can I execute a function on pressing the enter key in an field?](https://stackoverflow.com/questions/16011312/how-can-i-execute-a-function-on-pressing-the-enter-key-in-an-input-field) – AGE Oct 04 '21 at 15:10
  • no i need to click enter button using command like "document.getElementById("btn").click();" – Tharusha Thishakya Oct 04 '21 at 15:14
  • https://stackoverflow.com/questions/51775289/trigger-enter-keypress-in-vanilla-js – epascarello Oct 04 '21 at 15:18
  • @epascarello using onkeydown and searching for the keyCode is definitely a better approach, but it doesn't make my recommendation invalid. – AGE Oct 04 '21 at 15:24
  • @AGE THE OP is not listening for an event. They are trying to fire it. The OP even said it was wrong. The OP is automating the page, not coding it. – epascarello Oct 04 '21 at 15:25
  • noted, I went with the assumption that adding an event listener would be helpful to their use case which is what my recommended link suggests as an approach (on key down) – AGE Oct 04 '21 at 15:28
  • I am doing web-scraping ('https://www.twitchfollowing.com/') I need to *click Enter Button On Keyboard* By using the web console. I really don't know it is possible or not. – Tharusha Thishakya Oct 04 '21 at 15:28

0 Answers0