I\'d like to send some data using an XMLHttpRequest in JavaScript.
Say I have the following form in HTML:
<
You can catch form input values using FormData and send them by fetch
fetch(form.action, {method:'post', body: new FormData(form)});
function send() {
let form = document.forms['inputform'];
fetch(form.action, {method:'post', body: new FormData(form)});
}
Look: chrome console>network and click