subeer haldar
subeer haldar

Reputation: 137

How to access a file in a directory from other directory, when both are in same parent directory with HTML

enter image description here

How can i access 2.html from 1.html? When i click on a link given in 1.html. and both the directories are in same directory.

Upvotes: 1

Views: 68

Answers (2)

tenstar
tenstar

Reputation: 10506

if dir1 and dir2 are in the same parent directory then this is how you access 2.html from 1.html:

<a href="../dir2/2.html">link to 2.html</a>

hope it helped :)

Upvotes: 0

Mostafa Berg
Mostafa Berg

Reputation: 3239

Something like this should work (place in 1.html):

<a href="../dir2/2.html">Click me</a>

Upvotes: 2

Related Questions