xxxxxxxxxx
//HTML
<input type="text" name="name" id="uniqueID" value="value" />
//JS
var nameValue = document.getElementById("uniqueID").value;
xxxxxxxxxx
//Html
<form id="myForm" name="myForm">
<input id="email" name="email" value="some@email.com" />
</form>
//JS
var x=document.forms["myForm"]["email"].value;
xxxxxxxxxx
//html
<form id="myForm">
<input type="text" name="name" placeholder="Name">
<input type="email" name="email" placeholder="Email">
<button type="button" onclick="getFormValues()">Get Values</button>
</form>
//js
function getFormValues() {
var form = document.getElementById("myForm");
var nameValue = form.elements["name"].value;
var emailValue = form.elements["email"].value;
console.log("Name: " + nameValue);
console.log("Email: " + emailValue);
}