Assuming you're running on a Windows machine...

  1. Hit the F12 key
  2. Select the Scripts, or Sources, tab in the developer tools
  3. Click the little folder icon in the top level
  4. Select your JavaScript file
  5. Add a breakpoint by clicking on the line number on the left (adds a little blue marker)
  6. Execute your JavaScript

Then during execution debugging you can do a handful of stepping motions...

  • F8 Continue: Will continue until the next breakpoint
  • F10 Step over: Steps over next function call (won't enter the library)
  • F11 Step into: Steps into the next function call (will enter the library)
  • Shift + F11 Step out: Steps out of the current function

Update

After reading your updated post; to debug your code I would recommend temporarily using the jQuery Development Source Code. Although this doesn't directly solve your problem, it will allow you to debug more easily. For what you're trying to achieve I believe you'll need to step-in to the library, so hopefully the production code should help you decipher what's happening.

Answer from Richard on Stack Overflow
🌐
W3Schools
w3schools.com › js › js_debugging.asp
JavaScript Debugging
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
🌐
Chrome for Developers
developer.chrome.com › docs › chrome devtools › debug javascript
Debug JavaScript | Chrome DevTools | Chrome for Developers
May 22, 2024 - This tutorial teaches you the basic workflow for debugging any JavaScript issue in DevTools. Read on, or watch the video version of this tutorial. Finding a series of actions that consistently reproduces a bug is always the first step to debugging.
🌐
Programiz
programiz.com › javascript › debugging
Debugging JavaScript in Browser (with Examples)
You can set breakpoints for JavaScript code in the debugger window. JavaScript will stop executing at each breakpoint and lets you examine the values. Then, you can resume the execution of code. Let's see an example by setting a breakpoint in the Chrome browser.
Top answer
1 of 2
89

Assuming you're running on a Windows machine...

  1. Hit the F12 key
  2. Select the Scripts, or Sources, tab in the developer tools
  3. Click the little folder icon in the top level
  4. Select your JavaScript file
  5. Add a breakpoint by clicking on the line number on the left (adds a little blue marker)
  6. Execute your JavaScript

Then during execution debugging you can do a handful of stepping motions...

  • F8 Continue: Will continue until the next breakpoint
  • F10 Step over: Steps over next function call (won't enter the library)
  • F11 Step into: Steps into the next function call (will enter the library)
  • Shift + F11 Step out: Steps out of the current function

Update

After reading your updated post; to debug your code I would recommend temporarily using the jQuery Development Source Code. Although this doesn't directly solve your problem, it will allow you to debug more easily. For what you're trying to achieve I believe you'll need to step-in to the library, so hopefully the production code should help you decipher what's happening.

2 of 2
27

...How can I step through my javascript code line by line using Google Chromes developer tools without it going into javascript libraries?...


For the record: At this time (Feb/2015) both Google Chrome and Firefox have exactly what you (and I) need to avoid going inside libraries and scripts, and go beyond the code that we are interested, It's called Black Boxing:

When you blackbox a source file, the debugger will not jump into that file when stepping through code you're debugging.

More info:

  • Chrome: Blackbox JavaScript Source Files
  • Firefox: Black box libraries in the Debugger
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › code quality
Debugging in the browser
If there are no additional breakpoints, then the execution just continues and the debugger loses control. ... The execution has resumed, reached another breakpoint inside say() and paused there. Take a look at the “Call Stack” at the right. It has increased by one more call. We’re inside say() now. ... Run the next statement. If we click it now, alert will be shown. Clicking this again and again will step through all script statements one by one.
🌐
Bugfender
bugfender.com › blog › javascript-debugging
JavaScript Debugging: Tools, Tips & DevTools Guide | Bugfender
September 16, 2025 - The Chrome debugger section provides five controls to step through the code. ... This option enables you to step through line by line as the JavaScript code executes.
🌐
Medium
medium.com › @tonyeder11 › javascript-debugging-for-beginners-tips-and-tools-dff9069bb312
JavaScript Debugging for Beginners: Tips and Tools | by Tonyeder | Medium
November 21, 2023 - All modern browsers come with a built-in dev tool that provides you with a powerful space to debug JavaScript. Access the dev tools via any of the methods here: i. Right click your mouse and select ‘inspect.’ ... With the dev tool panel open, use the Console panel to view errors and log outputs and line numbers where errors may have occurred. Also check out Sources panel for more complex debugging.
🌐
Python Tutor
pythontutor.com › javascript.html
Online JavaScript Compiler, Visual Debugger, and AI Tutor - Learn JavaScript programming by visualizing code
Online JavaScript compiler, visual debugger, and AI tutor - the only tool that lets you visually debug your JavaScript code step-by-step (also debug Python, Java, C, and C++ code)
Find elsewhere
🌐
Frontend Masters
frontendmasters.com › courses › chrome-dev-tools › step-through-debugging
Step-Through Debugging - Mastering Chrome Developer ...
Whether you want to learn professional JavaScript and TypeScript, to back-end courses on Node.js, SQL, and beyond we have courses to bring your skills to the next level!
🌐
Mozilla
firefox-source-docs.mozilla.org › devtools-user › debugger
The Firefox JavaScript Debugger — Firefox Source Docs documentation
The JavaScript Debugger enables you to step through JavaScript code and examine or modify its state to help track down bugs.
🌐
Rheinwerk Computing
blog.rheinwerk-computing.com › how-to-debug-a-javascript-program
How to Debug a JavaScript Program
April 24, 2025 - Such breakpoints enable the developer ... step by step, starting at the breakpoint. To define a breakpoint, simply click to the left of the corresponding line in the source code (where the line number is). The blue mark shows that a breakpoint is defined for the corresponding line. ... When you subsequently reload the HTML file in the browser, the program stops exactly at the defined breakpoint. Defining Breakpoints Using the debugger Keyword: As ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › microsoft-edge › devtools › javascript
Get started debugging JavaScript - Microsoft Edge Developer documentation | Microsoft Learn
This article teaches you the basic workflow for debugging any JavaScript issue using DevTools. The first step in debugging is to find a sequence of actions that consistently reproduce a bug.
🌐
Raygun
raygun.com › learn › javascript-debugging-tips
The 16 JavaScript debugging tips you probably didn’t know
Chrome can unminify your Javascript files to a more human-readable format. The code won’t be as helpful as your real code – but at the very least you can see what’s happening. Click the {} Pretty Print button below the source viewer in the inspector. Let’s say you want to set a breakpoint in a function.The two most common ways to do that are: ‍1. Find the line in your inspector and add a breakpoint 2. Add a debugger in your script ‍In both of these solutions, you have to navigate manually around in your files to isolate the particular line you want to debug.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › debugger
debugger - JavaScript | MDN
function potentiallyBuggyCode() { debugger; // do potentially buggy stuff to examine, step through, etc. } When the debugger is invoked, execution is paused at the debugger statement. It is like a breakpoint in the script source. The Firefox JavaScript Debugger¶ in the Firefox source docs ... This page was last modified on ⁨Jul 8, 2025⁩ by MDN contributors.
🌐
DEV Community
dev.to › atapas › the-definitive-guide-to-javascript-debugging-2021-edition-116n
The definitive guide to JavaScript Debugging [2021 Edition] - DEV Community
January 5, 2021 - Let us see how to step through the breakpoints to figure out an issue. The debugger section provides five controls to step through the code. ... This option enables you to step through line by line as the JavaScript code executes.
🌐
Raygun
raygun.com › blog › javascript-debugging-major-browsers
The complete guide to debugging JavaScript in major browsers · Raygun Blog
May 9, 2021 - The complete guide to debugging JavaScript in major browsers. Step by step instructions for Google Chrome, Firefox, Safari and more.
Top answer
1 of 16
79

Firebug is one of the most popular tools for this purpose.

2 of 16
75

All modern browsers come with some form of a built-in JavaScript debugging application. The details of these will be covered on the relevant technologies web pages. My personal preference for debugging JavaScript is Firebug in Firefox. I'm not saying Firebug is better than any other; it depends on your personal preference and you should probably test your site in all browsers anyway (my personal first choice is always Firebug).

I'll cover some of the high-level solutions below, using Firebug as an example:

Firefox

Firefox comes with with its own inbuilt JavaScript debugging tool, but I would recommend you install the Firebug add on. This provides several additional features based on the basic version that are handy. I'm going to only talk about Firebug here.

Once Firebug is installed you can access it like below:

Firstly if you right click on any element you can Inspect Element with Firebug:

Clicking this will open up the Firebug pane at the bottom of the browser:

Firebug provides several features but the one we're interested in is the script tab. Clicking the script tab opens this window:

Obviously, to debug you need to click reload:

You can now add breakpoints by clicking the line to the left of the piece of JavaScript code you want to add the breakpoint to:

When your breakpoint is hit, it will look like below:

You can also add watch variables and generally do everything that you would expect in a modern debugging tool.

For more information on the various options offered in Firebug, check out the Firebug FAQ.

Chrome

Chrome also has its own in built JavaScript debugging option, which works in a very similar way, right click, inspect element, etc.. Have a look at Chrome Developer Tools. I generally find the stack traces in Chrome better than Firebug.

Internet Explorer

If you're developing in .NET and using Visual Studio using the web development environment you can debug JavaScript code directly by placing breakpoints, etc. Your JavaScript code looks exactly the same as if you were debugging your C# or VB.NET code.

If you don't have this, Internet Explorer also provides all of the tools shown above. Annoyingly, instead of having the right click inspect element features of Chrome or Firefox, you access the developer tools by pressing F12. This question covers most of the points.

🌐
Smashing Magazine
smashingmagazine.com › 2018 › 02 › javascript-firefox-debugger
Debugging JavaScript With A Real Debugger You Did Not Know You Already Have — Smashing Magazine
Here's the app, based on basic open-source JavaScript frameworks. Open it up in the latest version of Firefox Developer Edition and then launch debugger.html by hitting Option + Cmd + S on Mac or Shift + Ctrl + S on Windows.