Beginner problem with javascript code not working.
Hi, thanks for passing by :) i have the following code and i can't find the reason why it isn't working. I'll paste it. Basically i want the user to enter two lines of text, any text and have it pop up in an alert message when the submit button is clicked. Any help or questions are welcomed. <form onsubmit = "return cargar() method= post> Nombre o E-mail <input type="text" name= "nom" id="nom"> <br> Comentarios <input type="text" name="com" id="com"> <br> <input type="submit" value="Submit" /> </form> <script type= "text/javascript"> function cargar(){ var nom= document.getElementById(nom); var com= document.getElementById(com); alert (nom_value + " "+ com_value); } </script>