From the course: Learning JavaScript Debugging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Knowing when to stop

Solution: Knowing when to stop - JavaScript Tutorial

From the course: Learning JavaScript Debugging

Start my 1-month free trial

Solution: Knowing when to stop

(electronic music) - [Instructor] Here's one possible solution to this breakpoint challenge. Let's look at the checkout first. I'm going to open up my developer tools and here in the sources panel, this is conveniently opened up to the script block at the bottom of the file because I was already looking at it. And here is my event handler that's dealing with these close buttons. I'm using the element query selector here to grab the button close class, which if we inspect this element, I can right click and inspect that. I can see that both close button up in the corner and the close button down in the panel both have that same class. So the intention here was to grab either one of them and have them both use this same event handler. If I set a break point in here, this close button is caught by that handler. So that one definitely works as we can see. But if I open this again, I can click this as much as I want…

Contents