Explore the DOM with Firebug

A very useful Firefox extension that makes it both easy and fun to explore the DOM is Joe Hewitt’s FireBug. Firebug logs JavaScript, CSS, and XML errors to a console. You can configure which errors to log, so if you don’t want CSS errors in the Firebug console, just turn them off.

Want to explore the DOM of the document you are viewing? Just open the Firebug Inspector and the DOM is right there. Click the “Inspect” button and you can use your keyboard to navigate through the DOM. Anything you select in the inspector is highlighted on the rendered page.

When your scripting doesn’t work properly and you can’t figure out why, use Firebug’s lightweight JavaScript debugger to set breakpoints and examine your scripts as they execute.

Firebug does more than just inspect. It will also let you edit the values of existing attributes, which can be very useful when debugging. If you want to use another approach than “alert debugging” when working with JavaScript, you can use JavaScript to write text and objects to the FireBug console.

There’s more to FireBug than what I have described here, so try it out for yourself.

Comments

1. May 29, 2006 by Ara Pehlivanian

FireBug is so useful I sometimes wonder how I managed before it came along. Working on websites without FireBug is like trying to repair a car with a butter knife.

2. May 29, 2006 by Justin Palmer

I recently written in-depth about Firebug here: Javascript Debugging with Firebug.

The new version is packed with some very wonderful features.

3. May 30, 2006 by Darren Hoyt

Great Flash tutorial here:

http://www.digitalmediaminute.com/screencast/firebug-js/

4. May 30, 2006 by Henrik

Firebug is a great tool. It seems much more practical than Venkman, but still a bit awkward when compared to traditional language debuggers.

5. May 30, 2006 by Morgan Roderick

Amazing!

I :heart: Firebug a little more every day

6. May 30, 2006 by Tim Hofman

It's a great tool to use. I would recommend it to everybody.

7. May 30, 2006 by zcorpan

Sounds like an improved version of the built in Error Console (previously called JavaScript Console) and the DOM Inspector.

8. June 1, 2006 by Nigel : BiZwiKi.CN

ah.. Great plugin for me, just a little tricky with its Harsh checking lines.

9. June 2, 2006 by bart

Great start, but some styles don't show up in the inspector (text-indent:-5555px;).

Sorry, comments are closed for this post.

Information, sponsorship, and externals

About the author

Roger Johansson is a Swedish web professional specialising in web standards, accessibility, and usability. More about me and this site.

Subscribe

Looking for web hosting?

Try DreamHost!

Use the promo code 456BEREASTREET3 to save USD 20 when you sign up!

Latest articles

Validation statistics from Nikita the Spider Comments off
An analysis of the sites crawled by the bulk validation tool Nikita the Spider during March 2008.
Authentic Jobs API and Affiliates program Comments off
The Authentic Jobs job listing service now has a public API and an affiliate program.
What does Acid3 mean to you and me? Comments off
Opera and Apple have announced that their web browsers pass the Acid3 Browser Test, but how will that help web designers and developers?
Designing Web Navigation (Book review) Comments off
Learn the fundamentals of navigation design and design better navigation systems for large and small sites as well as for web based applications.
DOMAssistant bundle for TextMate Comments off
To save keystrokes and speed up development I have created a DOMAssistant bundle for TextMate.
First impressions of Internet Explorer 8 Beta 1 Comments off
My impressions after trying out Internet Explorer 8 Beta 1 for a couple of days.

More articles

Favourites, here and elsewhere

Affiliation

  • NetRelations
  • Kaffesnobben
  • Dagens recept
  • 9rules network member

Support this site

Show your support by buying a book or two from SitePoint or getting me something from my Amazon Wish List.