Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
Score not showing on screen but only in the console log

Html code part works well

   <div class =”flex-blackjack-row-3
       <table>
           <tr>
              <th>Wins</th>
              <th>Losses</th>
               <th> Draws</th>
           </tr>

           <tr>
               <td><span id=”wins”>0</span></td>
               <td><span id=”losses>0</span></td>
               <td><span id=”draws>0<</span></td>
           </tr>
    </div>

In the Javascript code, everything else but the showScore works. showScore is not putting the score there.

function blackjackHit() {
   let card = randomCard();
   console.log(card);
   showCard(card, YOU);
   updateScore(card, YOU);
   showScore(card, YOU);
  }

function showScore(activePlayer) {
   Document.querySelector(activePlayer[‘scoreSpan’]).textContent = activePlayer[‘score’];
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You missed some brackets and used erroneous quotation marks in your code. So, you need to be careful with the syntax in HTML and Javascript, as usually, the browser digests everything you code without advice. However, you can use the developer's tools in your browser to detect some of those problems. Concerning your question, try with the code below, where those problems are corrected:

HTML

<div class ="flex-blackjack-row-3">
       <table>
           <tr>
              <th>Wins</th>
              <th>Losses</th>
               <th> Draws</th>
           </tr>

           <tr>
               <td><span id="wins">0</span></td>
               <td><span id="losses">0</span></td>
               <td><span id="draws">0</span></td>
           </tr>
    </div>

Javascript

function blackjackHit() {
   let card = randomCard();
   console.log(card);
   showCard(card, YOU);
   updateScore(card, YOU);
   showScore(card, YOU);
  }

function showScore(activePlayer) {
   document.querySelector(activePlayer['scoreSpan']).textContent = activePlayer['score'];
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda