Is it possible to manipulate more than one HTML file in the same script?
For example, i have a <div id="div1"> on my index.html, and <div id="div2"> in another HTML file inside of another folder.
What i trying to do is get the content of the second div and replace to my "div1", but the "traditional way" doesnt work:
function replaceDiv(){
let div1 = document.querySelector('#div1')
let div2 = document.querySelector('#div2')
div1.innerHTML = div2
}
I'm new to programming, sorry if this is a dumb/obvious question haha
ps: both files have the link for the same script.
ps²: i know that i can manually write the string with innerHTML, but i wanna know if it's possible to do this