jQuery code to detect mobile devices

If you have been looking for a jQuery code to detect mobile devices. You have hit the right webpage. The below code will detect whether you are using an iPhone, iPad or a iPod or any other mobile device. It will display a message if you are not using any of the common mobile devices.

1. Include jQuery in your document using the below mentioned script.

2. Add the following at the bottom of your html/php document

3. Put the below code in the body of your document

jQuery code to detect mobile devices – Demo

Here is the link to the demo page.

Just run the demo page on any  mobile device to see the result.

Kindly comment if you any have feedback.

One thought on “jQuery code to detect mobile devices”

Comments are closed.