Use the accept attribute to set the types of files that the server accepts in HTML. Use the attribute only with <input type="file">.
You can try to run the following code to work with the accept attribute:
<!DOCTYPE html> <html> <head> <title>File Upload Box</title> </head> <body> <form> <input type = "file" name = "fileupload" accept = "image/*" /> </form> </body> </html>
The capture attribute is a boolean attribute that, if specified, indicates that the capture of media directly from the device...is preferred.
The capture attribute is NOT used to include the camera option in the dialog but to indicate that direct capture from the webcam is preferred.
The "correct" code is given below
<input type = "file" accept = "image/*">