if (!head) {
head = document.createElement('head');
if (document.documentElement) {
document.documentElement.insertBefore(head, document.documentElement.firstChild);
} else {
document.body.insertBefore(head, document.body.firstChild);
}
}
// Check if the tag exists inside
let title = head.querySelector('title');
// If doesn't exist, create it and append it to
if (!title) {
title = document.createElement('title');
title.textContent = " Events | Uni of Herts";
head.appendChild(title);
}
tag exists, create it if missing
let head = document.head || document.documentElement.insertBefore(document.createElement('head'), document.documentElement.firstChild);
// Ensure the tag exists inside , create it if missing
let title = head.querySelector('title') || head.appendChild(document.createElement('title'));
title.textContent = " Events | Uni of Herts";