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

109
Views
Necesito ayuda para agregar un botón para ejecutar una función en mi JavaScript

Necesito ayuda con mi JavaScript, cuando el usuario hace clic en el botón, quiero pedirle al usuario que ingrese un puntaje (0-100) y luego devolver una calificación basada en ese puntaje (por ejemplo, 100-80 = A, 79-60 = B) ... <30=F) Por cierto, explique cómo y por qué se hace cada paso porque soy bastante tonto, gracias.

 <!DOCTYPE html> <html> <head> <title>Marks to Grade Conversion</title> <style> h1 {font-family:serif; font-size:36px; color:#ff0000; text-align:center} h2 {font-family:sans-serif; font-size:24px; color:#000000; text-align:center} body {background-color:#FFCC00} </style> </head> <body> <h2>Faculty of Computer science</h2><br> <h1>End of year module test results Mark to Grade utility</h1><br><br> <h2>Click the button to enter the Mark and display the Grade</h2><br> <h2><button style="font-size:24px; height:50px; width:300px"; onClick="ConvertMark()"> Click to enter the mark </button></h2><br> <h1 id="display grade here"></h1></b></td>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

bastante básico escriba su función, obtenga entrada, convierta, muestre el resultado

 function ConvertMark(){ let display = document.getElementById('display') let grade = prompt("Enter grade: ") let alpha = ""; if (grade >= 90)alpha = 'A' else if(grade >= 80)alpha = 'B' else if(grade >= 70)alpha = 'C' else if(grade >=60)alpha = 'D' else alpha = 'F' display.innerHTML = alpha }
 h1 {font-family:serif; font-size:36px; color:#ff0000; text-align:center} h2 {font-family:sans-serif; font-size:24px; color:#000000; text-align:center} body {background-color:#FFCC00}
 <h2>Faculty of Computer science</h2><br> <h1>End of year module test results Mark to Grade utility</h1><br><br> <h2>Click the button to enter the Mark and display the Grade</h2><br> <h2><button style="font-size:24px; height:50px; width:300px"; onClick="ConvertMark()"> Click to enter the mark </button></h2><br> <h1 id="display"></h1>

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!