function create_notice(id, type, mesg) { let container = document.createElement('div'); container.id = id; container.classList.add('notice', `notice-${type}`, 'settings-error', 'is-dismissible'); container.innerHTML = `
${mesg}
`; return container; } export function show_notice(target, type, mesg) { target.querySelectorAll('.notice').forEach(x => x.remove()); const notice = create_notice('test', type, mesg); target.prepend(notice); }