Browser Developer Tools (DevTools) are built-in debugging and inspection tools available in all modern browsers. They let you inspect HTML and CSS, debug JavaScript, monitor network activity, test accessibility, and much more. Learning to use DevTools effectively makes you a faster, more efficient developer.
Every major browser has DevTools:
This lesson focuses on Chrome DevTools, but the concepts apply to all browsers.
<aside> 💡
DevTools are your debugging partner. Professionals use them constantly - not just when things break, but to understand how websites work, test changes quickly, and learn from other developers' code. In fact, most developers have them open by default when building web applications.
</aside>
Opening DevTools
Three ways to open DevTools:
Cmd + Option + IF12 or Ctrl + Shift + IQuick tip: Right-click directly on an element and select "Inspect" to open DevTools with that element already selected.
<aside> ⌨️
Hands On
Open any website and press F12 (or Cmd + Option + I on Mac). Notice the DevTools panel appears - you can dock it at the bottom, right side, or in a separate window. Try each docking position to find what works best for you.
</aside>
Inspect and modify HTML structure and CSS styling in real-time.
Inspecting Elements
Cmd/Ctrl + Shift + CEditing HTML
<aside> ⌨️
Hands On
<h1> to <h2>Run JavaScript, view errors, and test code interactively.
Console Messages
console.log("Normal message");
console.warn("Warning message");
console.error("Error message");
console.table([{name: "Alice", age: 25}]);
<aside> ⌨️
Hands On
console.log("Hello!")console.warn("Warning") and console.error("Error")View all files loaded by the page: HTML, CSS, JavaScript, images, API requests.
https://www.youtube.com/watch?v=e1gAyQuIFQo
Filter by type:
<aside> ⌨️
Hands On
Test on slower connections:
<aside> ⌨️
</aside>
Audit your page for accessibility issues:
<aside> ⌨️
</aside>
Test different screen sizes and devices.
Enable: Click device icon (📱) or press Cmd/Ctrl + Shift + M
Features:
<aside> ⌨️
</aside>
Global:
Cmd/Ctrl + Shift + C - Inspect elementCmd/Ctrl + Shift + M - Device modeF12 - Open/close DevToolsElements:
↑↓ - Navigate elements