Created
September 24, 2025 01:47
-
-
Save PhilsThinkerBox1982/f2b73f3db1cf99ba6898d55144fb9691 to your computer and use it in GitHub Desktop.
Web Browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| input { width: 200px; margin: 2px; font-size:24pt;background-color:darkgreen;color:lime} | |
| </style> | |
| </head> | |
| <body> | |
| <input type="text" id="urlInput" placeholder="e.g. example.com" style="border-radius:12px; font-size:48px; background-color:darkgreen; color:lime;width:600px;opacity:.5"/> | |
| <button onclick="webSearch()" style="border-radius:12px; font-size:48px"><strong>Go</strong></button> | |
| <script> | |
| function webSearch() { | |
| let input = document.getElementById('urlInput').value.trim(); | |
| if (!input) return; | |
| // If no protocol is provided, default to https:// | |
| if (!/^https?:\/\//i.test(input)) { | |
| input = 'https://' + input; | |
| } | |
| window.open(input, '_blank'); | |
| } | |
| document.getElementById('urlInput').addEventListener('keypress', function (e) { | |
| if (e.key === 'Enter') { | |
| openingInNewTab(); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment