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

83
Views
la pantalla de dinero no se actualiza

Al hacer clic id="bigButton" no se actualiza la cantidad de dinero que tengo. ¿Alguien sabe por qué?

 var money = 50 var stickAmount = 0 var clickValue = 1 + stickAmount window.onload = displayMoney(); function displayMoney() { document.getElementById('totalCurrentMoney').innerHTML = "$" + money; document.title = "$" + money + " - Arsenal Clicker"; } function click() { money = money + clickValue displayMoney() } function purchaseStick() { money = money - 50 stickAmount = stickAmount + 1 displayMoney() }
 .card-arangement { display: flex; justify-content: center; gap: 20px; }
 <div> <h1 align="center">Arsenal Clicker</h1> <h1 id="totalCurrentMoney" align="center">$5</h1> <div class="card-arangement"> <input type="image" id="bigButton" onclick="click()" src="Images/bigButton.png" height="500"> <div> <input type="image" id="stick" onclick="purchaseStick()" src="Images/stick.png" height="100"> <input type="text" id="stick" onclick="purchaseStick()" disabled placeholder="stick - $50" height="100"> </div> </div> </div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La función click() ya está definida en una entrada y tiene una prioridad más alta que su método.

Por lo tanto, cambie el nombre de la función click() a updateMoney

 <input type="image" id="bigButton" onclick="updateMoney()" src="Images/bigButton.png" height="500"> function updateMoney() { money = money + clickValue displayMoney() }
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!