+ 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 !
2 ответов
+ 4
Hey Calvin
I tried this code it's works
https://code.sololearn.com/Wpw60Q8s4p5d/?ref=app
+ 5
.value is used to get the input value.