Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

86
Visualizações
Tengo algunos errores en esta fuente.

Necesito ejecutar este código y resolver todos los problemas que contiene. Cuéntame los problemas y cómo solucionarlos. proyecto: ¿Cómo muestro el número del lugar de la letra en inglés, por ejemplo, si el usuario escribió a y presionó el botón, aparece el número 1, y si escribió b, aparece 2 y así sucesivamente. el código:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Alpha Position Finder</title> <script> let alphabets=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] document.addEventListener('DOMContentLoaded',function() { document.querySelector("button").onclick = finder; function finder() {; var check = document.getElementById('text').innerHTML; } } </script> </head> <body> <div> <h1>Welcome to alpha position finder.</h1> <p id="position"></p> <input type="text" placeholder="Enter alphabet" id="text"> <button>Find</button> </div> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Debe realizar los cambios marcados a continuación para que su código funcione. Lea acerca de Array.indexOf para comprender cómo funciona.

 let alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; document.addEventListener('DOMContentLoaded', function() { document.querySelector("button").onclick = finder; function finder() { var check = document.getElementById('text').value; // <-- CHANGE console.log("indexOf( " + check + ") = " + alphabets.indexOf(check) ); // <-- ADD } });
 <div> <h1>Welcome to alpha position finder.</h1> <p id="position"></p> <input type="text" placeholder="Enter alphabet" id="text"> <button>Find</button> </div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda