S.no | Contents-topics |
---|---|
1 | Introduction |
2 | HTML code |
We can use JavaScript window.matchMedia() method to detect a mobile device based on the CSS media query. This is the best and easiest way to detect mobile devices. So we can call the JavaScript window.matchMedia() method and set the max-width : 767px to check for mobile devices.
Code:.Copy
Also read:ENABLE/LOAD AND DISABLE CSS USING JQUERY
Output For Desktop/Tablet Devices
Output For Mobile Devices
Check Mobile Device
0 Comments (Please let us know your query)