With the web application am developing student discussion platform, I want a student to attach file when posting a question, I do not want to use a button, Instead, a student just clicks a hyperlink and the upload dialog box opens.
How to do it?
With the web application am developing student discussion platform, I want a student to attach file when posting a question, I do not want to use a button, Instead, a student just clicks a hyperlink and the upload dialog box opens.
How to do it?
You can create file input inside link and hide it with opacity:
a {
position: relative;
}
#file {
position: absolute;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
-moz-opacity: 0;
-khtml-opacity: 0;
opacity: 0;
cursor: pointer;
right: 0;
}
<a href="#"><input type="file" id="file"/>Link text</a>