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

235
Views
my currency converter question is i a need function to convert rand(ZAR) to pound, dollar, and euro

I need to put in a certain amount of rands and get back euro, pound, and dollar.

The rest of my code does have the link to the javascript file. I've only put the dollar() function in for now because I was at least trying to get one to work but it didn't so I need help.

function dollar() {
  let money = document.getElementbyId("rand").value;
  const $ = 15.5734;
  document.getElementById('result').innerHTML = $ * money;
}
<form>
  Rand: <input type="number" id="rand">
  <input id="dollar" type="button" onclick="dollar()" value="dollar"/>
  <input id="euro" type="button" onclick="euro()" value="euro">
  <input id ="pound" type="button" onclick="pound()" value="pound">
</form>
        
<p> result is: <span id="result"></span> </p>

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

0

You just needed to change function name and change document.getElementbyId to document.getElementById

<form>
  Rand: <input type="number" id="rand">
  <input id="dollar" type="button" onclick="todollar()" value="dollar"/>
  <input id="euro" type="button" onclick="euro()" value="euro">
  <input id ="pound" type="button" onclick="pound()" value="pound">
</form>
        
<p> result is: <span id="result"></span> </p>
<script>
function todollar() {
  let money = document.getElementById("rand").value;
  const $ = 15.5734;
  document.getElementById('result').innerHTML = $ * money;
}
</script>

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!