JS obtiene entradas de formulario

var inputs = document.getElementById("my-form").elements;
var inputByIndex = inputs[0];
var inputByName = inputs["username"];
Alan Rivera-Muñiz