Putting files in another folder | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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?

2nd May 2024, 5:50 PM
Oise Giwa-Okugbe
Oise Giwa-Okugbe - avatar
4 ответов
+ 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'.
2nd May 2024, 6:50 PM
`нттየ⁴⁰⁶
`нттየ⁴⁰⁶ - avatar
+ 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>
4th May 2024, 4:39 AM
Vidhya Tharan
Vidhya Tharan - avatar
+ 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>
4th May 2024, 5:24 AM
Chris Coder
Chris Coder - avatar
0
Hi
4th May 2024, 10:43 AM
Ram rathod
Ram rathod - avatar