Write a script to accept the first name and the last name from the user and print them together on the same line separated by a space ( javascript document)
Answers
Answered by
4
<input type="text" name="firstname" id="firstname">
<input type="text" name="lastname" id="lastname">
myFunction = function() {
var first = document.getElementById("firstname").value;
var second = document.getElementById("lastname").value;
document.getElementById("here").innerHTML = first+" "+second;
}
:) have a great day
Similar questions