I have the following code written in html
<form id = "name" action="../js/customerData.js">
First name: <input id = "firstName" type="text" name="firstName" placeholder="First Name"><br>
Last name: <input id = "lastName" type="text" name="lastName" placeholder="Last Name"><br>
<input type="submit" name="FLnames" id="FLnameVar" value="Submit">
</form>
And this code written in javascript which is what the form action calls
firstName = document.getElementByName("firstName");
lastName = document.getElementByName("lastName");
document.write(firstName);
However, when I submit the html form the browser just displays the javascript. Does anyone know why this is and how I can fix it? Thanks