LifePex/public/js/error.js
Arthur Poulet f6a951f704
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
userpex: improve error and fix test databases
2021-06-24 22:10:58 +02:00

12 lines
587 B
JavaScript

function flashError(message) {
const new_flash_error = document.createElement('p');
new_flash_error.classList.add("alert");
new_flash_error.classList.add("alert-danger");
new_flash_error.classList.add("alert-dismissible");
new_flash_error.classList.add("fade");
new_flash_error.classList.add("show");
new_flash_error.setAttribute("role", "alert");
new_flash_error.innerHTML = `${message} <button class=\"btn-close\" type=\"button\" data-bs-dismiss=\"alert\" aria-label=\"Close\" />`;
const flash = document.querySelectorAll('.flash')[0].appendChild(new_flash_error);
}