-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
17 lines (15 loc) · 713 Bytes
/
script.js
File metadata and controls
17 lines (15 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
document.addEventListener('DOMContentLoaded', () => {
console.log('DOM fully loaded and parsed');
const footerId = document.getElementById('footer_id');
const trm = document.getElementById('trm');
const pri = document.getElementById('pri');
const date = new Date();
const response = date.getFullYear();
footerId.textContent = `© ${response - 1}-${response} Xcoder, Inc. · `;
footerId.appendChild(trm);
footerId.appendChild(pri);
const spacer = document.createTextNode(' | ');
footerId.insertBefore(spacer, pri);
});
// The existing code is fine as it is and does not need to be moved inside DOMContentLoaded
// it is working fine because the script is placed at the end of the body tag.