Streaming live at 10am (PST)

How to capture a value from a input that is inside a form and save it to a variable in javascript

Hey guys, so i have this form that have a name, email and phone input fields.
im trying to capture what the user write in these inputs fields and register them into variables in the java script custom code when the user click on the submit button. here’s what i’m trying to do:

(function () {
document.getElementById(“button”).onclick = function () {
var name = document.getElementById(“name”).value;
var email = document.getElementById(“email”).value;
var telefone = document.getElementById(“Telefone”).value;
console.log(name);
console.log(email);
console.log(telefone);
};
})();

this code don’t give me any of the information i tried to find on the console.log.

can you guys help me capture these variables?

thanks in advance!