12 lines
587 B
JavaScript
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);
|
|
}
|