0
Why i still able to select all type file after Targeting pdf file via accept attribute?
Here's link: https://codepen.io/nur49/pen/xxEdVRZ
2 ответов
+ 1
As W3Schools says, the accept attribute is not a validation mean. In fact, input of type file will accept any kind of file. File-type filtering is done by the FileDialog of the OS. The only purpose of the accept attribute is to inform the Browser what file-type the OS FileDialog should filter.
So, the final behavior depends on the system/platform you're in.
0
https://www.w3schools.com/tags/att_input_accept.asp
<input type="file" accept="application/pdf" />