This is what I want to know if we can access multiple html file elements from the same external javascript file.
Scenario:
one.html
<div id="one" onclick="oneDIV"></div>
two.html
<div id="two" onclick="twoDIV"></div>
script.js
function oneDIV(){
var instance = document.getElementById("one");
}
function TwoDIV(){
var instance = document.getElementById("two");
}
The question would be more specific if I ask One JS File for Multiple Pages