JSFiddle - React, Tailwind, and code Playground
HTML
<div id="pageMiddle">
<div id="left_window">
<div id="project_description" name="project_description" contentEditable="true">Please enter project description...</div>
<center>
<button id="save" onclick="save_description()">Save</button>
</center>
</div>
</div>
JavaScript
function ajaxObj(meth, url) {
var x = new XMLHttpRequest();
x.open(meth, url, true);
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
return x;
}
function ajaxReturn(x) {
if (x.readyState == 4 && x.status == 200) {
return true;
}
}
function _(x) {
return document.getElementById(x);
}
document.getElementById('save').onclick = function () {
var des = _("project_description").innerHTML;
var ajax = ajaxObj("POST", "overview_page.php");
//ajax.onreadystatechange = function() sorry this one shouldn't be here
ajax.send("des=" + des);
}