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
KeyPad numbers in javascript on click event

I have this created a page with numbers and textbox in top of it as you see in the picture

enter image description here

The element id of the textbox is t1

the question is , what's the code I should write on click event to make the numbers written on the textbox .

For example , when I click (1) three times , the textbox should have the value of ( 111 )

any advices ?

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

0

JavaScript:

 function display(val)
 {
    document.getElementById("t1").value+=val
 }

HTML:

<input type="button" value="1" onclick="display('1')"/>
<input type="button" value="2" onclick="display('2')"/>
<input type="button" value="3" onclick="display('3')"/>

And so on..

display() will call the function to display the value what has been clicked.

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!