In this section, you will learn how to open the url on the window.
As we know that window.location object that contains the current URL information. In the given code the document.forms.url.value gets the entered URL and used this object to open the entered URL. For this purpose, we have created a textbox to allow the user to enter any URL to open and click the button. As you click the button, the entered URL will get open.
Here is the code:
Output will be displayed as:
Enter any URL you want to open:
When you submit the button, the entered URL will get open: