Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Jack HaXOr</title>
- </head>
- <body>
- <form action="/" method="get" accept-charset="utf-8" id="form">
- <input type="text" name="x" id="x" placeholder="Enter something here..." autofocus required>
- <button type="submit">GO</button>
- </form>
- <script>
- let form = document.getElementById('form');
- form.addEventListener('submit', function(e) {
- e.preventDefault();
- let id = document.getElementById('x').value;
- if (id && id !== '') {
- window.top.location.href = 'https://example.com/' + id;
- }
- }, false);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement