Skip to content

Commit 63e992b

Browse files
committed
Better DOM handling
1 parent 1ce667b commit 63e992b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

simpletoast.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@
7373
applyCSS(el, css);
7474

7575
// Add body
76-
el.textContent = text;
76+
const body = document.createElement('span');
77+
body.textContent = text;
78+
el.appendChild(body);
7779
const toast = {
7880
close: () => {
7981
root.removeChild(el);

0 commit comments

Comments
 (0)