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

155
Views
El número aleatorio solo muestra 0 en HTML y Javascript

Estoy haciendo un generador de números aleatorios donde el usuario ingresa 2 números para obtener un número aleatorio entre ellos, sin embargo, cuando lo ejecuto, el número aleatorio siempre muestra 0

El código está abajo:

 function generateRandomNumber() { var a = document.getElementById('number_a').value var b = document.getElementById('number_b').value var random = Math.floor(Math.random(a, b)) document.getElementById('randomNumber').innerHTML = random }
 <div> <input type="text" id="number_a" class="range" onkeypress="return isNumberKey(event)" title="FROM"> <input type="text" id="number_b" class="range" onkeypress="return isNumberKey(event)" title="TO"> <br> <button class="button" onclick="generateRandomNumber()">Generate random number!</button> <h1>Random number will generate here: <p id="randomNumber">Null</p> </h1> </div>

about 4 years ago · Juan Pablo Isaza
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!