I have created some htm pages with JavaScript code which I saved on my Windows desktop. The code runs fine after I confirm a prompt to run scripts or Active X, but as soon as I copy the file over to a network location (not a server) and try to open the file, JavaScript does not run any more (the prompt mentioned above does not appear). I did not have this problem with other code (including JavaScript) and I am not sure what the problem is - probably something around network safety settings?
Specifically, the following snippet seems to cause the problem:
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Dropdown</button>
<div id="myDropdown" class="dropdown-content">
</div>
</div>
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
.show {display:block;}
The button shows, but the dropdown menu does not show up when the file is saved on the network drive. So function myfunction() does not work apparently.