In this tutorial, we're going to try our hand at building a super-simple version of your favorite library. We're wrapping the elements in an object because we want to be able to create methods for the object. This is actually a boiled-down version of the way jQuery does it. So, now that we have our Dome object being returned, let’s add some methods. I’m going to put those methods to its prototype.

13m read timeFrom code.tutsplus.com
Post cover image
Table of contents
Step 1: Creating the Library BoilerplateStep 2: Getting ElementsStep 3: Creating Dome InstancesStep 4: Adding a Few UtilitiesStep 5: Working with Text and HTMLStep 6: Hacking ClassesStep 7: Fixing an IE BugStep 8: Adjusting AttributesStep 9: Creating ElementsStep 10: Appending and Prepending ElementsStep 11: Removing NodesStep 12: Working with EventsThat’s It!

Sort: