Neon 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>Neon Search Bar</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #000; color: #fff; font-family: 'Arial', sans-serif; } .search-container { position: relative; width: 400px; } .search-input { width: 100%; padding: 15px 20px; border: 2px solid #0ff; border-radius: 50px; background: transparent; color: #0ff; font-size: 18px; outline: none; box-shadow: 0 0 10px #0ff; transition: all 0.3s ease; } .search-input:focus { box-shadow: 0 0 20px #0ff; } .search-icon { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); font-size: 24px; color: #0ff; cursor: pointer; } </style> </head> <body> <div class="search-container"> <input type="text" class="search-input" placeholder="Neon Search..."> </div> <script> document.querySelector('.search-icon').addEventListener('click', () => { alert(`Searching for: ${document.querySelector('.search-input').value}`); }); document.querySelector('.search-input').addEventListener('keypress', (e) => { if (e.key === 'Enter') { alert(`Searching for: ${document.querySelector('.search-input').value}`); } }); </script> </body> </html>