-3

Hello i have a question with javascript , i need to develop 5 buttons in html and each button invoke a function from visual , each function has parameters such as function agregar(id, identificacion, nombre, apellido, fechaNacimiento) , i was thinking to develop textbox for each parameter of the function , but dont know how to call the function and to connect it with the "textbox" introduced in the page , any ideas ?

1
  • 1
    Translate your question into spanish please 'cause you're at SO en español, otherwise it will be closed
    – BetaM
    el 2 may. 2020 a las 15:17

1 respuesta 1

0

Puedes colocar un id a cada uno de los textbox y buttons

<input type="text" id="name" />
<button id="button1">Text</button>

en javascript:

const name = document.getElementById('name');
const myButton = document.getElementById('button1');

Para el botón puedes hacer algo como lo siguiente:

myButton.addEventListener('click', function(){
    nameValue = name.value();
});
0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.