+ 1
Putting files in another folder
For for example if you use a an index file outside of a folder and you want a button inside another folder like let's say a games file to lead to that outer one what would you do?
4 Answers
+ 2
You can link the button like that:
<button onclick="location.href='path/to/your/file.html'">Go to Another File</button>
Replace 'path/to/your/file.html' with the actual relative path to your file. For example, if your file is in a folder called "games" and it's named "index.html", you would replace it with 'games/index.html'.
+ 2
<!-- Inside the HTML file in the "games" folder -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Games</title>
</head>
<body>
<h1>Welcome to the Games Page</h1>
<button onclick="window.location.href='../index.html'">Go to Home</button>
</body>
</html>
+ 1
Depending on your folder structure.
C:\project01\games\index.html
C:\project01\index.html
<button onclick="window.location.href='games/index.html'">Games</button>
0
Hi