Usando formulários HTML para definir variáveis JavaScript
var firstName = document.getElementsByName("firstname")[0].value;
Foolish Ferret
var firstName = document.getElementsByName("firstname")[0].value;