Get id element of multiple html pages

Hello campers , I have single html page has multiple html pages in it , here is an img:

the issue is that I can not get an element by it’s id , this element is in history html page
it gives me null , how can I solve this ?
I can get any element that are in index.html , but I can not get the other injected html pages .
please help .

It doesn’t have multiple HTML pages in it, it’s just got links to other HTML pages. You can’t get IDs of elements on those pages without opening those pages.

A similar thing: if you search for something on Google, and you get a page of search results, you can’t look at what those search results are without clicking on the link and opening that web page. You can’t look at something without looking at it.

I have a table in history html page and I want to add in it some items from javascript , how can I do that ?

I am working with webpack ,can I use scripts for every html page ?
and use import export for transferring infos between them .
Thank you for your time .

No. There’s a basic misunderstanding here. You cannot look at something without looking at it. JavaScript does not make the laws of physical reality change.

If you need to get the IDs from the HTML on another HTML page, you have to literally load that page. You can do this programmatically using JavaScript (look up AJAX), but you have to load the HTML page, it doesn’t exist somewhere floating around in the ether just waiting for you to grab things from it.