How to Open the Native Camera in Mobile Browsers

Without using JavaScript

Implementation

The only requirement for using the native camera is the <input /> element with 3 attributes:

  1. accept="image/*" the file input accepts only files with an image/* MIME type
  2. capture="environment" the outward-facing camera should be used
Native camera in mobile browsers — HTML
Native Android camera
Native camera in mobile browsers — CSS
Native camera in mobile browsers — JavaScript

Result

Demo using the native camera in mobile browsers

The minimal demo displays a button that opens the camera and the picture you take.

Live demo: https://pixochi.github.io/native-camera-in-mobile-browsers