How to Open a Link Without Clicking on it using JavaScript? Last Updated : 03 Oct, 2024 Comments Improve Suggest changes Like Article Like Report To open a link without clicking on it we can use the onmouseover method of JavaScript. The link will open when the mouse moves over the text. It returns a newly created window, or NULL if the call gets failed. Syntax:window.open( URL, name, Specs )Note: Allow Pop-up of Web Browser. Example 1: URL is loaded into the new window. HTML <!DOCTYPE html> <html> <head> <title>Javascript open link without click</title> <style> .gfg { text-align: center; font-size: 40px; font-weight: bold; color: green; } </style> </head> <body> <div class="gfg" onmouseover="myFunction()"> GeeksforGeeks </div> <script> function myFunction() { window.open("https://www.geeksforgeeks.org"); } </script> </body> </html> Output:Example 2: URL is loaded into the current Window. HTML <!DOCTYPE html> <html> <head> <title>Javascript open link without click</title> <style> .gfg { text-align: center; font-size: 40px; font-weight: bold; color: green; } </style> </head> <body> <div class="gfg" onmouseover="myFunction()"> GeeksforGeeks </div> <script> function myFunction() { window.open("https://www.geeksforgeeks.org", "_top"); } </script> </body> </html> Output:Example 3: URL is loaded into the new window of specific size. HTML <!DOCTYPE html> <html> <head> <title>Javascript open link without click</title> <style> .gfg { text-align: center; font-size: 40px; font-weight: bold; color: green; } </style> </head> <body> <div class="gfg" onmouseover="myFunction()"> GeeksforGeeks </div> <script> function myFunction() { window.open('https://www.geeksforgeeks.org', ' ', 'width=500, height=300'); } </script> </body> </html> Output: Comment More infoAdvertise with us Next Article How to Open a Link Without Clicking on it using JavaScript? N Naman_Garg Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Questions Similar Reads How to Open a Popup on Click using JavaScript ? Opening a Pop-up when the click action is performed is the user-interactive technique. We can use this functionality in messages, or forms to show some error or alert messages before the user moves to the next action.Table of ContentUsing display propertyUsing classList PropertyUsing visibility prop 4 min read How to open URL in a new window using JavaScript? In HTML, the anchor tag (<a>) is used to open new windows and tabs in a very straightforward manner. However, there are situations where you need to achieve the same functionality using JavaScript. This is where the window.open() method becomes useful.The window.open() method is used to open a 3 min read How to replace plain URL with link using JavaScript ? Given a plane URL, the task is to replace the plain URLs with the links. This problem can be solved with the help of Regular Expressions. Approach:Â Using RegExp and replace() MethodRegExp - This looks for the URL in the provided text.This RegExp parses the URL and puts the address to the $1 variable 2 min read How to submit a form by clicking a link in JavaScript ? Submitting a form by clicking a link in JavaScript involves binding a click event handler to the link element. When clicked, the handler triggers the form's submit action programmatically, allowing form submission without the need for a traditional submit button. ApproachHTML Structure:Basic HTML st 2 min read How to disable right click on web page using JavaScript ? Disabling right-click on a web page can be done using the DOM Events. It is a client-side action, and it can be achieved using JavaScript. However, it's important to note that attempting to prevent right-clicking is not a foolproof method for protecting your content, as users can easily bypass it by 2 min read Like