2023-01-21 14:08:22 +00:00
|
|
|
var range;
|
|
|
|
|
|
|
|
function add(html, id) {
|
|
|
|
const old = document.getElementById(id)
|
|
|
|
if (old !== null) {
|
|
|
|
old.remove()
|
|
|
|
}
|
|
|
|
if (range === undefined) {
|
|
|
|
var range = document.createRange()
|
|
|
|
range.setStart(document.body, 0)
|
|
|
|
}
|
|
|
|
document.body.appendChild(
|
|
|
|
range.createContextualFragment(html)
|
|
|
|
)
|
2023-01-23 03:04:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function remove(id) {
|
|
|
|
const old = document.getElementById(id)
|
|
|
|
if (old !== null) {
|
|
|
|
old.remove()
|
|
|
|
}
|
2023-01-21 14:08:22 +00:00
|
|
|
}
|