No you cannot "set .js page's scope to specific
window. This cannot be changed.
In addition to the global scope, other scopes may also exist at runtime, as determined by the structures within the code that you have written, particularly functions.
The terminology used is not exact, but we could call it a contextual script element, or something.
Such thing was possible in Explorer.
<div id=div1> div1 content </div> <script for=div1 event=onlouseover src=div1.js></script>
But it becomes expensive, I never used it..
adn I liked the old editor better!
ofcourse you can use a diferent eventhander on every div
<div id="div1" onmouseover="handeldiv1()" >
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.