Course:Internet & Tools/
Lesson

You asked Claude to build a card component. It looks great in the chat window. You paste it into your project, refresh the page, and the layout is completely broken, text overflows, buttons are misaligned, and the background color is wrong. Now what? You could go back to the AI and say "fix it," but that starts a guessing game. The faster path is opening DevTools and seeing exactly what went wrong in 30 seconds.

DevTools is not just a debugging tool, it is the verification layer between what an AI promises and what the browser actually renders.

Opening DevTools

The fastest way to open DevTools is a keyboard shortcut. Once you have used it a few times it becomes muscle memory.

BrowserMac shortcutWindows/Linux shortcut
ChromeCmd+Option+ICtrl+Shift+I or F12
FirefoxCmd+Option+ICtrl+Shift+I or F12
EdgeCmd+Option+ICtrl+Shift+I or F12
SafariCmd+Option+I (after enabling)N/A
Safari requires a one-time setup: go to Safari → Settings → Advanced, then check "Show features for web developers." After that, Cmd+Option+I works like other browsers.

You can also right-click any element on a page and choose "Inspect", this opens DevTools with that element already highlighted in the Elements panel. This is the fastest way to inspect a specific component that AI generated.

02

The Elements panel, verifying AI-generated layouts

When Copilot generates a component and the layout looks wrong, the Elements panel is your first stop. It shows you the live DOMWhat is dom?The Document Object Model - the browser's live representation of your HTML page as a tree of objects that JavaScript can read and modify., the parsed, rendered version of your HTML. It is not the source file you wrote; it is what the browser actually built from it.

<!-- v0 generated this card component -->
<!-- But in the browser, the image overflows its container -->
<div class="card" style="width: 300px;">
  <img src="photo.jpg" style="width: 100%;" />
  <div class="card-body">
    <h3>User Name</h3>
    <p>Description text that might be very long...</p>
  </div>
</div>

Click the element in the Elements panel, then look at the Styles sub-panel on the right. You will see every CSS rule affecting the selected element, including inherited styles and browser defaults. The Computed tab collapses all those rules into final values.

// In the Console, $0 refers to whichever element is
// currently selected in the Elements panel
$0.style.overflow = 'hidden';
$0.style.borderRadius = '8px';
// Test the fix live before editing your source code
When ChatGPT gives you CSS, always verify it in the Computed tab. AI tools frequently generate conflicting rules, for example, setting both width: 100% and a fixed max-width that contradicts the parent container. The Computed tab shows you which rule actually won.
03

The Console panel, your first error detector

Every JavaScript error that AI-generated code throws shows up in the Console as a red message with a file name and line number. Clicking that link jumps you directly to the offending code in the Sources panel.

// Claude generated this event handler
// but it crashes because 'items' is undefined on first render
const total = items.reduce((sum, item) => sum + item.price, 0);
// Console shows: Uncaught TypeError: Cannot read properties
// of undefined (reading 'reduce')

Beyond errors, the Console is a JavaScript playground. You can run any valid expression, inspect variables, and test fixes before committing them to your code. DevTools also exposes several shortcuts unique to the Console:

// Shorthand for document.querySelector
$('h1')           // Returns the first <h1>
$('.card')       // Returns all elements with class "card"

// $_ holds the result of the last expression you ran
2 + 2             // 4
$_ * 10           // 40

// $0 through $4 hold the last five elements selected in Elements panel
$0                // Most recently selected element
04

The Network panel, catching failed APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses. calls

Every image, stylesheet, script, font, and API call your page makes shows up in the Network panel. When Copilot generates a fetch call and the data never loads, this is where you find out why, wrong URL, missing auth header, or a 500 from the server.

ColumnWhat it shows
NameFilename or endpoint path
StatusHTTP status code (200, 404, 500, etc.)
TypeResource type (xhr, fetch, script, stylesheet)
InitiatorWhat triggered the request (which file and line)
SizeBytes transferred / actual resource size
TimeTotal duration from request sent to last byte received

Click "Fetch/XHR" in the filter bar to show only API calls and hide all static assets. This makes it much easier to find the request that is failing.

05

The Sources panel, where real debugging happens

The Sources panel shows every JavaScript file the page has loaded and lets you set breakpoints, markers that pause execution at a specific line so you can inspect what is happening. This is the single most important panel for understanding AI code you did not write. You will learn much more about this in the Debugging JavaScript lesson.

06

The Application panel, inspecting stored data

The Application panel gives you a window into everything the browser is storing on behalf of your site:

Storage typeWhat it holdsCommon AI-code issue
Local StorageKey-value pairs that persist across sessionsAI stores sensitive tokens here instead of httpOnly cookies
Session StorageKey-value pairs cleared when the tab closesAI forgets to clear stale session data
CookiesName-value pairs sent with every requestAI sets wrong SameSite or Secure flags
IndexedDBStructured data in a client-side databaseAI creates entries but never cleans them up

You can read, edit, and delete entries directly from this panel. If you need to clear a JWTWhat is jwt?JSON Web Token - a self-contained, signed token that carries user data (like user ID and role). The server can verify it without a database lookup. tokenWhat is token?The smallest unit of text an LLM processes - roughly three-quarters of a word. API pricing is based on how many tokens you use. stored in Local Storage to test a login flow, this is where you do it.

AI tools like ChatGPT routinely generate code that stores JWTs in localStorage. This is a security risk, localStorage is accessible to any JavaScript on the page, including XSS attacks. Always verify where AI stores authentication tokens by checking the Application panel.
07

Quick reference

PanelPrimary useWhen to open it
ElementsInspect and edit HTML/CSSAI layout looks wrong
ConsoleRun JS, view logs and errorsAny time, check here first
NetworkMonitor HTTP requestsAI fetch call fails or data missing
SourcesSet breakpoints, step through JSLogic bugs in AI-generated code
ApplicationInspect storage and cookiesAuth issues, stale data
PerformanceProfile runtime speedAI code causes jank or slowness