Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!