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 respuesta
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();
});