const loginForm = document.getElementById("login-form");
loginForm.addEventListener("submit", handleSubmit);
function handleSubmit(e) {
e.preventDefault();
const formData = new FormData(e.target);
const formProps = Object.fromEntries(formData);
}
<input id="input" type="text">
<button onclick="handleInput()">Submit</button>
<script>
let inputText = document.querySelector("#input");
let button = document.querySelector('button');
let handleInput = () => {
button.innerHTML = inputText.value;
}
</script>
var text = document.querySelector('#text').innerText; //'#':id '.':class
// return data in key value pair
$('#form').serializeArray().reduce(function(obj, item) {
obj[item.name] = item.value;
return obj;
}, {});