+ 1

Javascript

So I am trying to get a button to work using java script. When I type in text in my first name text box, I am trying to have the web page display the first name after I press the button. I have the Var $ = function(id) { return document.getElementById(id); }; function Submit () { document.write($(“first_name”).textContent); } With first_name being the id for the text box and Submit being the onClick function and id ! It’s not working though .. Any help would be great !

26th Sep 2018, 6:22 AM
Calvin
Calvin - avatar
2 odpowiedzi
+ 4
26th Sep 2018, 7:07 AM
Calviղ
Calviղ - avatar
+ 5
.value is used to get the input value.
26th Sep 2018, 6:53 AM
Toni Isotalo
Toni Isotalo - avatar