so i have mor than 1 html file and in each of these theres an element like <p> with id:'level1' so ```<p id="level1"></p>
on a js file file i have:
var level1 = {
name: 'Hello',
author: 'me',
id: '1'
}
and then i write those info on html page with innerText, but i tried innerHTML and TextContent too
document.getElementById('level1').innerText = level1.name;
and with all the other names, but i see these on all the files only the first var info but i have other var like level2 level3 that are printed in the same way but the others are only shown on one html file
on my code i have:
index.html
<!-- #1 -->
<div class="table">
<a href=""><img class="thumb" onclick="video1x1()" src="images/img1.jpg" width="16%" height="80%"></a>
<a href="list/1"><p class="p1" id="level1"></p></a>
<p class="author" id="author1"></p>
</div>
<!----->
and on another html file:
1.html
<p class="title" id="level1"></p><a href="../2"><p class="ttitle">></p>
this work for level1 var idk why but for the others no.
basically i want that it write like level1.name on every element that has id="level1"