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

208
Vistas
Extract input value html and js

Im trying to extract the values of my inputs. Im using this inputs in a JavaScript. Im using the onclick event on an input type button called thebutton and I want to extract the values in a function called data. The inputs are print in a div called formulary and I want to print the input values in a div called results. When I run it, the three values are print as undefined. So this is my current code:

<script>
 document.getElementById("fomulary").innerHTML+="<br>Data:<br><br>  <form><input id='name' type='text' placeholder='Name'<br><br><input id='address' type='text' placeholder='Address'<br> <br> <input id='tel' type='tel' placeholder='Phone number'><br> <input onclick='data()' type='button' id='thebutton' value='Send'></button> </form>";
     
      var name=document.getElementById("name").value;
      var address=document.getElementById("address").value;
      var tel=document.getElementById("tel").value;
    

function data(name, address, tel){

      document.getElementById("results").innerHTML=name+" "+address+" "+tel;
      
    }
  
<script>

Thank you.

about 4 years ago · Juan Pablo Isaza
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