Okay, so I have three text boxes. My goal is to have a fourth text box that is generated when the user clicks the button. The fourth text box should be populated with the input from the other three boxes. I've managed to do this with the code here:
<html>
<head></head>
<body>
<script>
function addTextBox() {
var element = document.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("id", "Text4");
document.body.appendChild(element);
fill();
}
function fill() {
input = document.getElementById("Text1").value + " " + document.getElementById("Text2").value + " is " + document.getElementById("Text3").value;;;
document.getElementById('Text4').value = input;
}
</script>
<form>
<input type="text" id="Text1" value="Firstname">
<input type="text" id="Text2" value="Lastname">
<input type="text" id="Text3" value="Age">
<input type="button" onclick="addTextBox()">
</form>
</body>
</html>
But there's one last thing I need to do. When the user inputs their age in the third textbox, I need to have in converted to their age in days before it appears in the fourth box.
Can anybody help me do this?