function ajaxRequest() { const request = new XMLHttpRequest(); request.open("POST", "handler"); request.addEventListener("load", () => { const responseText = request.responseText; const targetElement = document.getElementById("buttonAdd"); const divElement = document.createElement("div"); divElement.classList.add("form-control"); divElement.style.backgroundColor = "#bbbbbb"; // Задайте здесь свой нужный стиль divElement.innerHTML = responseText; targetElement.insertAdjacentElement("beforebegin", divElement); }); request.send(); }