Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

110
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda