use below script which allow to detect many device. this script allow you to detect single or multiple device browser
var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPod|ipad/i); }, ipad : function(){ return navigator.userAgent.match(/iPad/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, BB: function() { return navigator.userAgent.match(/BB10/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows() || isMobile.BB()); } }; call like below if(isMobile.any()) // this function gives if any mobile browser if(isMobile.ipad()) // return if ipad