Aquest tipus d’entrada s’han de fer com HTML
<!DOCTYPE html>
<html lang="ca">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Capsa Replicadora</title>
<link rel="icon" href=".ico" type="image/x-icon">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: flex-start;
background-color: #f0f0f0;
min-height: 100vh;
}
.container {
background-color: rgb(213, 225, 225);
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 80%;
max-width: 800px;
margin-top: 50px;
box-sizing: border-box;
}
h1 {
text-align: center;
color: #333;
}
p {
margin: 5px 0;
color: #444;
}
.input-wrapper {
width: 50%;
margin: 0 auto 10px auto; /* Centra les entrades */
}
/* Responsivitat per a dispositius petits */
@media (max-width: 600px) {
.container {
width: 90%;
margin-top: 30px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Capsa Replicadora</h1>
<div class="input-wrapper">
<label for="cercar">Cercar:</label>
<input type="text" id="cercar" name="cercar" autofocus onkeyup="replicarText()">
</div>
<div class="input-wrapper">
<label for="replicar">Replicar:</label>
<input type="text" id="replicar" name="replicar">
</div>
</div>
<script>
function replicarText() {
//alert('entra a replicar');
var cercarInput = document.getElementById('cercar');
var replicarInput = document.getElementById('replicar');
replicarInput.value = cercarInput.value;
}
</script>
</body>
</html>