I have a question, we were required to do a form fill in which must contain a user name, first name, last name, and gender, what should i do for the inputted values to be displayed inside a table after pressing a button?
<html>
<head>
<script>
function myfunction() {
var fn = document.form1.firstname;
var ln = document.form1.lastname;
var un= document.form1.unsername;
var g = document.form1.gender;
first = first + fn.getElementById("firstname").value;
last = last + ln.getElementById("lastname").value;
user = user + un.getElementById("username").value;
gend= gend + g.getElementById("gender").value;
document.getElementById("displayhere").innerHTML;
}
</script>
</head>
<body>
<form id="formname">
first name: <input type="text" id="firstname">
last name: <input type="text" id="lastname">
gender: <input type="text" id="gender">
username: <input type="text" id="username">
<button onclick="myfunction()">Send</button>
</form>
Details:
<table>
<tr><td><p id="displayhere"></p></td></tr>
</table>
</body>
</html>