Good evening, i was working on a part of what i hope will be my future website and i wanted to add a "photograpy" section to it, and here comes the problem. since the title in the main page constatly changes color, i'd like to grab its current color to transfer it to the title of the other page to play an animation later on. the problem is that when i press the related button, i am taken to the photograpy page, but the title remains black. i've tried seraching for help on google but i haven't been able to find much. here is the JS
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", function() {
loaded();
});
} else if (document.attachEvent) {
document.attachEvent("onreadystatechange", function() {
loaded();
});
}
function loaded() {
document.getElementById("PHtitle").style.color === titlecolor;
}
function script() {
const titlecolor = document.getElementById("title").style.color;
};
document.getElementById('photograpy').onclick = function () {
script();
};