I don’t know why this keeps happening, but when I fill out the form I get the first variable and then [object HTMLInputElement] for the other variables:
function insert(){
var studentId = document.getElementById(‘student’).value;
var firstName = document.getElementById(‘first’).value;
var lastName = document.getElementById(‘last’).value;
var phone = document.getElementById(‘tel’).value;
var studentRecord = studentId + first + last + tel; //used to store a student record
alert(studentRecord);
}
Or is there a different way to place these values into 1 variable with JavaScript?