Urban Search Bar - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Urban Search Bar</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: url('https://source.unsplash.com/random/1920x1080?city') no-repeat center center/cover; font-family: 'Arial', sans-serif; } .search-container { width: 400px; } .search-input { width: 100%; padding: 15px 20px; border: 2px solid #343a40; border-radius: 10px; background: rgba(255, 255, 255, 0.8); font-size: 18px; outline: none; } </style> </head> <body> <div class="search-container"> <input type="text" class="search-input" placeholder="Urban Search..."> </div> <script> document.querySelector('.search-input').addEventListener('keypress', (e) => { if (e.key === 'Enter') { alert(`Searching for: ${document.querySelector('.search-input').value}`); } }); </script> </body> </html>