JSFiddle - React, Tailwind, and code Playground
HTML
<form enctype="multipart/form-data" action="/echo/html" method="post" name="fileinfo" accept-charset="windows-1251">
<label>Label:</label>
<input type="text" name="label" size="12" maxlength="32" value="får løbende" /><br />
<input type="submit" value="Send standart">
</form>
<button onclick="sendForm()">Send ajax!</button>
JavaScript
window.sendForm = function() {
var oOutput = document.getElementById("output"),
oData = new FormData(document.forms.namedItem("fileinfo"));
var oReq = new XMLHttpRequest();
oReq.open("POST", "/echo/html", true);
oReq.send(oData);
}