Skip to content
Related Articles

Related Articles

Improve Article

How to make an HTML link to open a folder?

  • Difficulty Level : Expert
  • Last Updated : 14 Apr, 2020

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:




<!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>

Output:

On clicking the link:



Example 2:




<!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>

Output:

On clicking the link:

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :