How to make an HTML link to open a folder?

HTML can be used to open a folder from our local storage. In order to open a folder from our local storage, use ‘HREF’ attribute of HTML. In the HREF attribute, we specify the path of our folder.

Syntax:

<a href="Path"></a>

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
<head>
    <title>Sample Code</title>
</head>
 <body>
    <h1>Opening a folder from HTML code</h1>
    <a href="D:\Series\Breaking Bad">Click to open a folder</a>
</body>
</html>

chevron_right


Output:

On clicking the link:



Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
<head>
    <title>Sample Code</title>
</head>
 <body>
    <h1>Opening a folder from HTML code</h1>
    <a href="C:\Users\ABC\Desktop\cpp">
        Click to open a folder
    </a>
</body>
</html>

chevron_right


Output:

On clicking the link:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


2


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.