Uso de formularios HTML para definir las variables de JavaScript
var firstName = document.getElementsByName("firstname")[0].value;
Foolish Ferret
var firstName = document.getElementsByName("firstname")[0].value;