Skip to content

Instantly share code, notes, and snippets.

@sakuro
Last active May 21, 2018 01:33
Show Gist options
  • Save sakuro/1de391cfef5968bee7c2aff5e5a0bc1d to your computer and use it in GitHub Desktop.
Save sakuro/1de391cfef5968bee7c2aff5e5a0bc1d to your computer and use it in GitHub Desktop.
Bulmaの .delete を子に持つなにか(たとえば .notification)を削除
document.querySelectorAll('.delete').forEach((elm) => {
elm.addEventListener('click', (ev) => {
const target = ev.target.closest('.notification');
if (target) {
target.parentNode.removeChild(target);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment