Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    What if the browser is chrome? Commented Oct 20, 2021 at 10:47
  • 1
    @IBG just tried and it returns "undefined" on iOs chrome. So this answer is not correct Commented Nov 2, 2021 at 10:29
  • 2
    @IBG I just tried this on Firefox 38.1 on iPhone (iOS 14.3) and Chrome 95.0.4638.50 on iPad (iPadOS 15.0.2) and it worked on both Commented Nov 2, 2021 at 10:43
  • 2
    @strix25 are you sure you typed the code correctly? Commented Nov 2, 2021 at 10:44
  • Using the const in @JefferyTo's example above worked well for me with this conditional check: if (isIOS === true ) { //stuff for iOS } else {// stuff for all other } Commented May 20, 2022 at 14:10