screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> </head> <body> <div class="container"> <input type="text" class="name" oninput="handleInputChange(event)" placeholder="Name"> <input type="email" class="email" oninput="handleInputChange(event)" placeholder="Email"> <input type="text" class="address" oninput="handleInputChange(event)" placeholder="Address"> <p id="result">Result : </p> </div> <script> function handleInputChange(event) { const inputElement = event.target; const inputValue = inputElement.value; const resultParagraph = document.getElementById('result'); if (inputElement.classList.contains('name')) { resultParagraph.textContent = 'Name changed: ' + inputValue; } else if (inputElement.classList.contains('email')) { resultParagraph.textContent = 'Email changed: ' + inputValue; } else if (inputElement.classList.contains('address')) { resultParagraph.textContent = 'Address changed: ' + inputValue; } else { resultParagraph.textContent = 'Unhandled input: ' + inputValue; } } </script> <style> .container { margin: 50px auto; width: 300px; } input { display: block; width: 100%; margin-bottom: 15px; padding: 8px; font-size: 16px; } </style> </body> </html>