In this case, the iphone can be used to adjust the camera and album function, but the Android phone only to adjust the album;
<input id= "Uplicense" onchange= "Preview (this,0)" type= "file" name= "Uplicense" >
<input id= "Uplicense" onchange= "Preview (this,0)" type= "file" Name= "Uplicense" accept= "image/*" capture= "Camera" >
This, however, allows the Android phone to simultaneously bring up the camera and the album, but the iphone can only be adjusted to the camera:
<input id= "Uplicense" onchange= "Preview (this,0)" type= "file" Name= "Uplicense" accept= "image/*" capture= "Camera" Multiple>
So, the combination can be written at the outset:
<input id= "Uplicense" onchange= "Preview (this,0)" type= "file" Name= "Uplicense" accept= "image/*" capture= "Camera" Multiple>
And then in the page JS in this write:
$ (function ()) {
Compatibleinput ();
}
Determine if the current iOS mobile is compatible with input phone albums and cameras
function Compatibleinput () {
Get the browser's useragent and convert to lowercase
var ua = Navigator.userAgent.toLowerCase ();
Determine if it is an Apple phone, yes it is true
var Isios = (ua.indexof (' iphone ')! =-1) | | (Ua.indexof (' ipad ')! =-1);
if (Isios) {
$ ("Input:file"). Removeattr ("capture");
};
}
Compatible with Android and Apple Mobile, input phone albums and cameras