Browser DevTools
Opening DevTools and navigating the panels
Skills taught: web.devtools-navigation, web.inspect-element, web.devtools-panels
Opening DevTools
Windows/Linux:
F12
Ctrl + Shift + I
Right-click any element → 'Inspect'
Mac:
Cmd + Option + I
Right-click any element → 'Inspect'
Tip: Press F12 while DevTools is open to close it.
Tip: Click the ⋮ icon → Dock side to undock or move DevTools.
The panels
- Elements — View and edit the live HTML and CSS of any element. Changes appear instantly on the page but are not saved to your file.
- Console — Run JavaScript, see
console.log() output, errors, and warnings. - Network — See every HTTP request the page makes. Essential for debugging APIs and slow loads.
- Sources — Browse and debug JavaScript files. Set breakpoints to pause execution.
- Application — Inspect cookies, localStorage, sessionStorage, IndexedDB, and Service Workers.
- Performance — Record and analyze page rendering performance. Find what is making the page slow.
- Lighthouse — Automated audits for performance, accessibility, SEO, and PWA features.
The Elements panel
The Elements panel shows the live DOM — the browser's understanding of your HTML. It is not the same as your source file: JavaScript may have added elements, and the browser may have fixed invalid HTML.
- Click the cursor icon (top-left of DevTools) then click any element on the page to jump to it in the Elements panel
- Click any HTML element to select it — its CSS appears in the Styles pane on the right
- Double-click any attribute or text to edit it live
- Right-click an element → Delete element to remove it temporarily
- In the Styles pane, click a CSS property value to edit it — great for testing changes before writing them in your editor
Tip: Changes in DevTools are temporary — they reset on page reload. Use DevTools to experiment and find the right value, then write it in your actual code.
Frequently Asked Questions
Which browser has the best DevTools?
Chrome DevTools is generally considered the most feature-rich, with the best performance profiling and Lighthouse integration. Firefox DevTools has unique strengths in CSS Grid and Flexbox inspection — it draws visual overlays showing grid lines and flex containers. Safari DevTools is required for debugging iOS devices. Most developers use Chrome DevTools day-to-day.
Can I use DevTools on my phone?
Yes, through remote debugging. Connect your Android phone to your computer via USB, enable USB debugging in Android developer options, then open chrome://inspect in Chrome on your desktop. You can see and interact with DevTools for the browser running on your phone.