-1

So I have tried this one: <input type="url" id="textbox" /> <input type="button" id="btn" value="Submit" onClick="javascript: window.location = document.getElementById('textbox').value; /> What I tried to do was that my site would have a text area where I can write a URL and then once you've pressed "Submit" would go to that site without opening a new window or tab. What mistake I have made?

NPCFISH
  • 3
  • 1
  • 5

1 Answers1

0

<input type="url" id="textbox" /> <input type="button" id="btn" value="Submit" onClick="window.location = document.getElementById('textbox').value;" />
dinesh oz
  • 342
  • 1
  • 9
  • Please do not simply post some code. You should explain what you did and how it solves the issue. https://stackoverflow.com/help/how-to-answer – Seblor Apr 08 '22 at 10:04