The JavaScript cheat sheet is designed to act as a reminder and reference sheet, listing methods and functions of JavaScript. It includes reference material for regular expressions in JavaScript, as well as a short guide to the XMLHttpRequest object. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size JavaScript cheat sheet.
Functions and Methods
JavaScript has a huge number of methods and functions available. The cheat sheet lists these in various sections. On the left is a list of simple methods in JavaScript. On the right are DOM methods. Functions are in their own section at the bottom of the page.
XMLHttpRequest
The XMLHttpRequest object is relatively new to JavaScript. It is used to make requests and receive responses in XML format from a server, allowing developers to create interactivity with the server without the need for page refreshes (see the "Live Search" on the right of this page for an example). This section of the cheat sheet is a short reference to the object, containing a list of useful methods and properties, the syntax for creating the object in different browsers, and the various readyState values.
JavaScript in HTML
This section contains simple HTML, showing how to add JavaScript to an HTML document.
Regular Expressions
JavaScript contains support for regular expressions. This section shows the format, modifiers and pattern syntax of regular expressions in JavaScript.
Event Handlers
Personally, I often forget the exact names of the various event handlers in JavaScript. This list contains all of the event handlers available in JavaScript.
Download
So now that you know what it does, please feel free to print out the JavaScript cheat sheet:
Please note: If you wish to link to the JavaScript cheat sheet from elsewhere, please link to this page so others find the description, rather than linking directly to the sheet.
And finally, if you like the cheat sheets, and want to say thanks, please consider buying me something from my Amazon Wishlist. Thankyou very much to those who have already hunted it down and sent me something nice - I'm very grateful!

93 Comments
Thanks for creating this sheet.
#1, Rahul Jain, United States, 1 August 2005. Reply to this.
This is great, thanks for making all of your cheat sheets. I make use of your CSS one a lot, so kudos and the sort.
#2, Matt Thompson, United States, 1 August 2005. Reply to this.
good stuff! thank you.
#3, iiome, France, 1 August 2005. Reply to this.
Great ideas! Any chance you could do a "Cheat Sheet" on how you creat these wonderful beauties so that we might contribute others?
#4, Daniel Cline, United States, 1 August 2005. Reply to this.
Thanks very much. I was just fiddling with js this weekend and wishing I had a good cheat sheet.
#5, Smithee, United States, 2 August 2005. Reply to this.
Just found these cheat sheets today and I've already used them twice. Thanks!
#6, Ben Cochran, United States, 2 August 2005. Reply to this.
Hi Daniel. The cheat sheets are created through a long process of scribbling notes. My desk is covered in printouts and jottings from the various languages I use. These cheat sheets are based on those notes, with various other bits and pieces added. The idea is that they provide quick access to the stuff people often can't remember quickly or are always looking up.
Thanks, all, for your comments!
#7, Dave Child, United Kingdom, 2 August 2005. Reply to this.
Hello, thanks for creating that sheet. Within PDF, all Fonts look rather ... rasterized. Do you have the possibility to recreate those PDFs with PDF-Fonts, that scale clear?
#8, Harald Armin Massa, Germany, 2 August 2005. Reply to this.
On each Cheat Sheet, why not to align the vertical text of the left column to the left, instead of right ?
It will be easier to read and more efficiently. No ?
#9, Laurent B, France, 2 August 2005. Reply to this.
Hi Dave.
These sheets are great!
Just one thing..
What are you using to create the pdf's? I have noticed that you have rasterised them. Is there any reason for this? Embeded fonts would print so much nicer.
Marc
#10, Marc Castles, Australia, 2 August 2005. Reply to this.
Hi Marc,
I am working on better versions of the cheat sheets at the moment. Hopefully I'll have them ready in the next few weeks!
#11, Dave Child, United Kingdom, 2 August 2005. Reply to this.
Any plans to offer a Flash MX cheat sheet?
#12, Glenn McLelland, United States, 2 August 2005. Reply to this.
Thanks for creating this sheet, Dave, I will keep an eye on your site ;)
With warm greetings from Saarbuecken, Germany,
Vitaly Friedman
#13, Vitaly Friedman, Germany, 9 August 2005. Reply to this.
PDF version is with almost 0% quality.
#14, Sam, Finland, 17 August 2005. Reply to this.
I love you
#15, Thanks, Denmark, 23 August 2005. Reply to this.
hi there,
there is an implicit object with which every (ordinary) function is associated with. The exact implicit object itself is dependent on the environment(I.E, mozilla, rhino, etc). This is same for Ruby language too.
Replies: #89 and #89.
#16, anjan bacchu, United States, 1 September 2005. Reply to this.
This is great, thanks a lot!
#17, Richard Hein, Canada, 2 September 2005. Reply to this.
good job ! thank you
#18, Robert, Belgium, 6 September 2005. Reply to this.
wow the PDF can not be searched and text can not be selected !!!
Can you please fix that ?
thanks
#19, Robert, United States, 7 September 2005. Reply to this.
Thanks. Keep up good work. :)
#20, Davor, Canada, 9 September 2005. Reply to this.
Shouldn't the event handlers be all lower-case?
Also, might want to remove the "on" part, since DOM 2 and 3 work with just the event type name without the "on" prefix.
#21, Felipe, United States, 15 September 2005. Reply to this.
Actually, the correct way to implement JavaScript Code into an XHTML 1.x Strict page is:
<script type="text/javascript">
//<![CDATA[
//your javascript here...
//]]>
</script>
Notice that there is NO language attribute.
Notice the CDATA Wrapper, which is idicating that the code in between is not XML-Formed.
wbr
B!
#22, Bramus!, Belgium, 30 November 2005. Reply to this.
This is wonderful, thank you for the effort!
#23, RG, United States, 1 December 2005. Reply to this.
Thanks for this cheat sheet with explanation of sections. :) I am linking it from my site.
#24, Sandy, United States, 3 December 2005. Reply to this.
Excellent!
#25, Kenneth, Malta, 5 December 2005. Reply to this.
Very good site! I like it! I just wanted to pass on a note to let you know what a great job you have done with this site..Thanks!
#26, Sergej Brin, Ireland, 18 December 2005. Reply to this.
Great work! Thanks a lot!
This has motivated me to make a Prototype (http://prototype.conio.net/) cheat sheet
#27, cavorite, Colombia, 30 January 2006. Reply to this.
I am missing "call" and "apply", or am I just too short-sighted?...
Thanks
#28, Green, Germany, 8 March 2006. Reply to this.
Very handy!
#29, Douglas Clifton, United States, 30 March 2006. Reply to this.
ThanQ very much
#30, mjmohan Reddy, India, Hyderabad, India, 6 May 2006. Reply to this.
This is absolutely perfect.
And Love And Other Near Death Experiences is a brilliant book.
Either way, thanks so much for taking the time. These are great.
#31, Chris Cardinal, United States, 23 May 2006. Reply to this.
Love IT!
#32, Michel, Netherlands, 16 June 2006. Reply to this.
Great idea, almost makes me wish I could program. Only comment - why not make the PDF a true PDF instead of a packaged image. Would make for a nicer printed copy
#33, Phillip, United States, 17 June 2006. Reply to this.
I'm always looking at sites on my favourites. This a great handy idea. Thank you
#34, Gonzalo, Canada, 19 June 2006. Reply to this.
The PDF Sheet seems to lack
getElementsByName
document.getElementsByName("preserve")[i].style.color = colour;
#35, Charlie Mansfield, United Kingdom, 20 June 2006. Reply to this.
It's a great tool.I always keep referring to it while coding. It has made life easier
#36, Priyadarshi Chaudhuri, India, 26 June 2006. Reply to this.
It's a great peace of work.
#37, Baskar, United States, 26 June 2006. Reply to this.
Hi and Thank you for the cheat sheet. It's very handy. I do have an request though, is it possible to get also operators included? I mostly forget them, and its very frustating ;-)
#38, Jani Sjölund, Finland, 3 July 2006. Reply to this.
Hi, great sheet! I'm almost using it daily now. As a webdeveloper this is really handy as a quickreference, it's even faster than googling :).
But by using it I found a 'bug, in the 'range' section you list 'parentElement', but parentElement is only supported by IE, FireFox does not. So it's better to use parentNode, which is supported by both browsers.
#39, Marijn, Netherlands, 7 August 2006. Reply to this.
Great sheet. How can I download all the sheets ? The pdf only contains the first page.
#40, Sean, Ireland, 13 September 2006. Reply to this.
Ah , there is only one. Thanks
#41, Sean, Ireland, 13 September 2006. Reply to this.
Great stuff !. I'm going to link to this from my class site for all of my students. This will be a huge help to them. Many thanks for your hard work!
#42, Charlie Smith, United States, 2 September 2008. Reply to this.
May I use it in face book as a symbol for javascript group in Spanish ?
#43, Alexv, Argentina, 4 September 2008. Reply to this.
Is it just me, or can only the first page of each cheat sheet be downloaded? I cannot see any pages after the first page.
#44, Don, United States, 11 September 2008. Reply to this.
@Don: Just you, I'm afraid - the cheat sheets are all one page intentionally - they're supposed to be single page references.
@Alexv: Certainly. It's released under a CC license.
@Everyone Else: Thanks :)
#45, DaveChild, United Kingdom, 11 September 2008. Reply to this.
Ah, yep. Sorry, my boneheaded mistake. LOL!
Remember, we can't even vote right down here. *chuckle!*
#46, Don, United States, 11 September 2008. Reply to this.
By the way, really nice cheat sheets!
#47, Don, United States, 11 September 2008. Reply to this.
Hi,
I want to make you my compliments for your blog.
it is very interesting and I think that I will become one reader of your blog.
#48, echoweb, Unknown, 12 September 2008. Reply to this.
Thousand thanx' what u've ever made friend. :)
Great job!
#49, Selo, Hungary, 14 October 2008. Reply to this.
Very useful cheat sheets for programmer.
Great job you did....
#50, Saqib Ansari, Unknown, 7 November 2008. Reply to this.
A huge "Thank you!" I stumbled upon your work several years ago and have been referring your site to my students. I return often, myself, just to see what is new. Thanks for saving me so much time. You are a true blessing.
#51, TenHearts, Unknown, 1 December 2008. Reply to this.
This document doesn't contain methods call parameters :(
#52, zaNNer, Unknown, 22 December 2008. Reply to this.
Lovely resource, thanks for putting it into one easy to read page.
#53, Greg, Unknown, 8 February 2009. Reply to this.
thanks
#54, manoj, Unknown, 12 February 2009. Reply to this.
I'm vote for jQuery
thanks in advance :^)
#55, Dmitry, Unknown, 19 February 2009. Reply to this.
Dave,
Thank you for this cheat sheet. It is very helpful. Can you make one for the IRS 1040? (just kidding) George
#56, George, Unknown, 21 February 2009. Reply to this.
This has been very useful. Thank you.
#57, micaleel, United Kingdom, 4 March 2009. Reply to this.
Thank YOU very much for creating the cheat sheets.
As a beginner it helps tremendously.
#58, Admir Mujkanovic, Unknown, 17 March 2009. Reply to this.
This is very helpful, is there a way of creating a cheat sheet for XSLT and XML??
#59, Gaby O, Mexico, 2 April 2009. Reply to this.
Thanks for creating this sheet
#60, Alexandre Broggio, Brasil, 30 April 2009. Reply to this.
Great job! thank for your sheet :)
#61, Noname, AU, 1 May 2009. Reply to this.
I really need it!
Thanks
#62, Amitis, Unknown, 7 May 2009. Reply to this.
It's very useful for me.Thanks very much!
I'm waiting for jQuery Cheat Sheet.
I hope it'll come out soon!
#63, hiro, china shanghai, 2 June 2009. Reply to this.
Simply the best. Great Cheat Sheet!
#64, Lars, Germany, 24 June 2009. Reply to this.
thanks a ton for creating these cheatsheets .... just downloaded php, mysql, and javascript .. they are awesome and full of content for quick reference .. thanks again ..
#65, Hinvi Developer, Pittsburgh, 9 August 2009. Reply to this.
i need a post script
#66, hei, romania, 19 August 2009. Reply to this.
Thank you for this cheat sheet and the others on your site.
#67, Angela Hayden, United States, 27 August 2009. Reply to this.
Excellent! Thank you
#68, alma kubek, Ukraine, 17 September 2009. Reply to this.
Very good job , but could you call them reminder sheets please .
Again very helful thank's a lot ....
#69, Evan, London, 17 September 2009. Reply to this.
What you just created is a brilliant work of art man.. I will print them and distribute them to my students as a reference...I hope you don't mind if I start using them for my web design classes?
#70, BTH, Unknown, 22 September 2009. Reply to this.
Very Very Good Job Thanks a lot
#71, Anonymous, Netherlands, 28 October 2009. Reply to this.
Excellent piece, thank you big...
#72, Sliper, Belorussia, 10 December 2009. Reply to this.
Keep on your good work!
#73, SITS, 23 December 2009. Reply to this.
This Javascript CS is absolutley awesome. Very helpful reference in my workflow.
Thank you!
#74, Izdelava spletnih strani, Slovenia, 20 January 2010. Reply to this.
You are awesome! I am a student studying website design. This will help so much, I will share your site with my class.
Thanks!
#75, Sherri Brady, USA, 25 January 2010. Reply to this.
thx for making this.
#76, dde, 12 February 2010. Reply to this.
Thank you for creating this cheat sheet! Only problem is that when I download the pdf, I only get the first page...
#77, Jennifer, 17 February 2010. Reply to this.
This is so sweet and kind of you! Thank you so much! I am in a new job and have to 'pick up' some Java Script knowledge. I've forgotten a lot of what I knew!
Thanks again!
Biljana
#78, Biljana Katic, Australia, 14 March 2010. Reply to this.
Thanks for the cheat sheet . Your cheat sheet rocks :D
#79, Zahid, Bangladesh, 14 March 2010. Reply to this.
great thanks
#80, l'homme collectif, 17 March 2010. Reply to this.
This Javascript CS is absolutley awesome. Very helpful reference in my workflow
#81, siirt, turkey, 21 March 2010. Reply to this.
Muy buen trabajo y gracias ;)
#82, Alejandro, Chile, 23 April 2010. Reply to this.
Hi,
is this cheat sheet updated to the last Javascript spec ?
Thanks
#83, curvenut, 7 May 2010. Reply to this.
thank you for sharing this. great help for a new to the xhtml thing.
#84, Bram, Philippines, 4 August 2010. Reply to this.
mistake: "A normal function is not associated with an object".
right: "A normal function is associated with window object".
Thanks.
#85, nepalich, 13 November 2010. Reply to this.
The event handlers should all be lowercase.
Otherwise, thank you for the sheet. :)
#86, thekodols, 19 January 2011. Reply to this.
really it's too useful for our web developers who use rapidly this type of java script.
#87, --, India, 25 January 2011. Reply to this.
Thank you very much. Great work!
#88, shiham, 3 March 2011. Reply to this.
#87
you're right.
thank author for this cheat sheet.
#89, Jan, 6 June 2011. Reply to this.
Thank you! This is awesome!
#90, Kara, US, 9 June 2011. Reply to this.
Thanks for this Cheat Sheet, this helped to resolve some the Javascript issues that i had. Greetings and keep up these useful cheat sheets ;-)...
#91, Markus, Germany, 11 June 2011. Reply to this.
I have a website that deals primarily with seo (that's not what this comment is about...) and it has been a huge blessing to find all this script info in one place, making my projects easier to find, if it is ok with you when I put my new site up in a couple of days, can i link to your page? Send me an email, and thanks!
#92, stefan, usa, 28 July 2011. Reply to this.
Hi, Thanks! I can only download the first sheet. Would like the others too. Any help much appreciated!
#93, Sue, USA, 29 September 2011. Reply to this.