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

237
Views
No se pueden usar entradas de usuario de opciones y campos de texto en una función

Soy bastante nuevo en la programación, estoy tratando de obtener la entrada del usuario de las opciones de "provincia" y el valor de "ingresos" y usarlo en la función js a continuación, pero no puedo averiguar qué es lo que está mal.

 <div class="taxform"> <form> <label for="province">Please select your province from the list below: </label> <select id="province" name="province"> <option value="0">Select option</option> <option value="1">Newfoundland and Labrador</option> <option value="2">Prince Edward Island</option> </select> </form> <form> <label for="income">Please enter your annual income: </label> <input type="number" value="" id="income" name="income"> <br> <br> <button onclick="calculate(document.getElementById('province').value,document.getElementById('income').value)">Calculate</button> </form>
 function calculate() { var percentage; var province = province(document.taxform.province.value); var income = income(document.taxform.income.value); if province = 1 { percentage = 20; } else if province = 2 { percentage = 30; } var res = (income - ((percentage / 100) * income)); alert(res); }
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!