Answers for "how to find out if the user is on mobile or pc in js?"

0

how to find out if the user is on mobile or pc in js?

if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  // true for mobile device
  document.write("mobile device");
}else{
  // false for not mobile device
  document.write("not mobile device");
}
Posted by: Guest on March-15-2021

Code answers related to "how to find out if the user is on mobile or pc in js?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language