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?
Asked
Active
Viewed 329 times
-1

NPCFISH
- 3
- 1
- 5
-
1You forgot the double quotes to end the string after `value;`. – Seblor Apr 08 '22 at 08:20
1 Answers
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