get form data and assign to variable javascript code example
Example 1: using html forms to define javascript variables
var firstName = document.getElementsByName("firstname")[0].value;
Example 2: javascript form data
var formData = new FormData();