If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Behind the scenes: Browse the jQuery source code

You might be thinking jQuery is pretty magical at this point, with everything it can do. But it's not magic, it's just a whole lot of JavaScript - and since it's open source, anybody can browse the code of jQuery and see the magic for themselves.
You can see the source on Github, or use these two sites that make it easier to browse through: jQuery source viewer and jQuery deconstructed.
For example, take a look at the code for the html() method. It does a lot of checks for various error conditions and edge cases and eventually, it runs the line of code that actually tells the browser to set the inner HTML contents:
elem.innerHTML = value;
It can be intimidating to look at the code for jQuery, because it involves both advanced JavaScript syntax and a whole lot of expert knowledge about how browsers work - but it can also be really cool to see all the code that goes into making a powerful JS library that works across so many browsers.

Want to join the conversation?