The JavaScript “Ah ha!” Moment

Avatar of Chris Coyier
Chris Coyier on (Updated on )

A number of years ago we talked about The CSS “Ah ha!” Moment. That is, the moment in which you learned something about CSS that made it click for you and had the feeling of understanding wash over you. For CSS, mine was realizing that every element on the page was a rectangular box that lay themselves out in a particular manner and that I could affect the size, position and contents of those boxes.

Let’s do it again, only for JavaScript! If you feel like you have a decent understanding of JavaScript, what was your “Ah ha!” moment? Or are you still waiting for it?

For me, I had never written a line of JavaScript in my life but I picked up the book Learning jQuery and started reading it on a flight. I had the moment when I realized jQuery was essentially a “find something, do something” library. I already knew CSS, and jQuery used CSS selectors for the “find something” part. “Do something” in jQuery can be as simple as “click”, “hide”, “show”, “slideToggle”, etc. Even I can do that, I thought, and I rushed to my hotel room and started playing.