0

How to display DIV only in android device ?

i want to add button that if you click it go in whatsapp app. bot only in android devices

Bnaidt
  • 5
  • 1
  • 1
    Possible duplicate of [Detect Android phone via Javascript / jQuery](http://stackoverflow.com/questions/6031412/detect-android-phone-via-javascript-jquery) – Ionut Mar 23 '17 at 13:40
  • Where is your code? What have you tried? [How to create a Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve) – Neo Mar 23 '17 at 13:49

1 Answers1

1

Using navigator.userAgent you are able to check operating system of agent who opens your page. For example try this:

var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
if(isAndroid) {
  // SHOW YOUR DIV
}
Blady214
  • 689
  • 6
  • 17
  • Answer copied from here http://stackoverflow.com/questions/6031412/detect-android-phone-via-javascript-jquery – Ionut Mar 23 '17 at 13:39