Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Inspect Element on iPhone: Full Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To inspect elements on an iPhone, you can't use a direct right-click like on a desktop, but you can use Safari's built-in Web Inspector with a Mac, or use a third-party browser app that offers DOM inspection. The easiest method is connecting your iPhone to a Mac and using Safari's Develop menu. If you only have an iPhone, you can use a dedicated app like Inspect Browser or Web Inspector.

What You'll Need

  • An iPhone running iOS 14 or later (for most methods)
  • A Mac computer with Safari (for the Web Inspector method)
  • A USB cable to connect iPhone to Mac (or same Wi-Fi network)
  • For the app method: a free app from the App Store (e.g., Inspect Browser)

Step-by-Step

Method 1: Using Safari Web Inspector (with a Mac)

  1. On your Mac, open Safari and go to Safari > Settings (or Preferences on older macOS).
  2. Click the Advanced tab and check the box at the bottom that says "Show features for web developers" (or "Show Develop menu in menu bar").
  3. On your iPhone, go to Settings > Safari > Advanced and toggle on "Web Inspector".
  4. Connect your iPhone to your Mac using a USB cable. If prompted, tap "Trust This Computer" on your iPhone.
  5. Open Safari on your iPhone and navigate to the webpage you want to inspect.
  6. On your Mac, in Safari's menu bar, click Develop. You'll see your iPhone's name listed. Hover over it and select the webpage title from the dropdown.
  7. A Web Inspector window will open on your Mac, showing the HTML and CSS of the page. You can click any element in the inspector to see its code and modify it live.

Method 2: Using a Third-Party Browser App (iPhone only)

  1. Open the App Store on your iPhone and search for "inspect element" or "web inspector".
  2. Download a reputable app like Inspect Browser or Web Inspector (both are free with in-app purchases).
  3. Open the app and enter the URL of the webpage you want to inspect in its address bar.
  4. Once the page loads, tap the inspect icon (usually a cursor or a bracket symbol) in the app's toolbar.
  5. The app will show the page's HTML source. Tap on any element to highlight it in the page view and see its CSS styles.
  6. You can edit the HTML or CSS directly in the app and see the changes reflected immediately.

Method 3: Using Safari's "Show Page Source" (limited)

  1. Open Safari on your iPhone and go to the webpage.
  2. Tap the Share button (square with arrow up) in the bottom toolbar.
  3. Scroll down and tap "Show Page Source" (if you don't see it, tap "Edit Actions" and add it first).
  4. This opens a plain text view of the HTML source. You can copy it or search within it, but you cannot edit or see live CSS.

Common Mistakes

  • Not enabling Web Inspector on both devices: Forgetting to turn on the Develop menu on Mac or Web Inspector on iPhone is the most common reason the method fails.
  • Using the wrong cable: Some USB cables only charge and don't transfer data. Use the original Apple cable or a certified one.
  • Not trusting the computer: When you connect your iPhone to a new Mac, you must tap "Trust" on the iPhone popup. If you miss it, disconnect and reconnect.
  • Expecting right-click on iPhone: There is no native right-click inspect on iPhone Safari. You need a workaround or an app.
  • Editing live code permanently: Changes made in Web Inspector are temporary and disappear when you refresh the page. They are for testing only.

Tips

  • Use the Elements tab in Web Inspector to see the DOM tree. Click the arrow icon (cursor) to select an element directly on the page.
  • In Web Inspector, you can use the Console tab to run JavaScript commands on the page, which is useful for testing.
  • If you're on a Windows PC, you can't use Safari Web Inspector. Use a third-party app on your iPhone instead.
  • For quick checks, use the "Show Page Source" method to see the HTML, but for CSS and live editing, use a dedicated app.
  • Keep your iPhone and Mac on the same Wi-Fi network if you want to use wireless inspection (after initial USB pairing).

Troubleshooting

If the Develop menu doesn't show your iPhone:

  1. Make sure both devices have Web Inspector enabled (check steps above).
  2. Disconnect and reconnect the USB cable.
  3. Restart both Safari on Mac and Safari on iPhone.
  4. Try a different USB port on your Mac.
  5. If using wireless, ensure both are on the same Wi-Fi and that you've previously connected via USB.

If the third-party app doesn't show the page correctly:

  1. Some websites block in-app browsers. Try a different app or use Safari's Web Inspector.
  2. Update the app to the latest version from the App Store.
  3. Check if the webpage uses heavy JavaScript that the app can't render fully.

If you can't find "Show Page Source" in Safari:

  1. Tap the Share button, then scroll to the bottom and tap "Edit Actions".
  2. Find "Show Page Source" in the list and tap the plus (+) icon to add it to your share sheet.
  3. Now it will appear in the share sheet whenever you need it.

Frequently Asked Questions

Can I inspect element on iPhone without a Mac?

Yes, you can use a third-party app like Inspect Browser or Web Inspector from the App Store. These apps provide a built-in browser with DOM inspection tools.

Is there a way to right-click inspect on iPhone Safari?

No, Safari on iPhone doesn't have a right-click context menu for inspecting. You must use the Web Inspector with a Mac or a third-party app.

Can I edit a webpage's HTML on my iPhone and save it?

No, any changes you make in Web Inspector or a third-party app are temporary and only affect the current session. You cannot permanently alter a live website.

Does the Web Inspector work with Chrome on iPhone?

No, the Web Inspector method works only with Safari on both iPhone and Mac. For Chrome on iPhone, you'd need to use a different tool or app.

Why can't I see the Develop menu in Safari on my Mac?

You need to enable it in Safari's Settings under the Advanced tab. Check the box that says "Show features for web developers".

Can I inspect elements on a webpage that is inside another app (like Facebook's in-app browser)?

No, you can only inspect pages that are open in Safari or a dedicated browser app. In-app browsers don't expose their web content to external tools.