After creating links that connect two HTML files, I encountered an issue where one link does not work. The situation involves a folder named aiGame containing the aiindex.html file along with ai.js and ai.css. It is worth noting that the index.html file is not stored in a separate folder.
In the aiindex.html file within the aiGame folder, there are two links leading to the same file that do not function as intended:
<button id="twoPlayer" onClick= "location.href='index.html'"> 2 Player </button>
<a href="index.html"> 2 Player </a>
On the other hand, there are two links in the index.html file that successfully lead to the desired file despite pointing to the same location:
<button id="aiPlayer" onClick= "location.href='aiGame/aiindex.html'"> Play AI </button>
<a href="aiGame/aiindex.html"> Play AI </a>
The discrepancy between the functioning and non-functioning links has left me puzzled. Given that both syntaxes are correct yet ineffective, I wonder if there might be an issue with the actual files themselves. If anyone has insights on how to resolve this dilemma, I would greatly appreciate it. Thank you.