elementals.js was created as an amalgam of routines I use a lot in my code. Unlike larger "frameworks" it doesn't try to change how javascript works, it simply enhances the existing way of doing things and fills in some obvious 'blanks' in the specification. I also have added a few shim/polyfill to it to allow the use of some ECMAScript 252-5 functions in browsers that don't usually support them.

Really most of the existing "frameworks" are WAY to massive to have any business on a normal website. Many of them by themselves gZip COMPRESSED are fully half the size I usually allow for an entire page template's HTML + CSS + scripts + images; and that's BEFORE you actually start adding actually USEFUL scripting to the page. In addition, they are quite often chock full of functions that most people would never use, outright abuse, are CSS' job, or just plain don't belong on a website!


  1. 15.5k Uncompressed size, minified serves gzipped as 3.7k - a full tenth your typical "framework"
  2. Designed for inclusion before </body>, speeding load time, encouraging the use of scripts that attach themselves rather than called by the tags in the markup or inlined in the document.
  3. Provide shims for missing ECMAScript 262-5 functions like String.trim or Array.indexOf in browsers that don't support them.
  4. Cross-browser AJAX object creation that allows passing a series of 'readystate' and 'status' handlers.
  5. uSort method for Lists and Tables.
  6. DOM walking tools like various 'each', 'next' and 'prev' methods, that can be passed a 'mask' for either specific tags, or nodetypes.
  7. Class handling methods akin to those in the new Element.classList property, but with more consistent naming conventions, not quite so buried in an element's properties, and a few extra bells and whistles. Laughably it turns out the regEx I made for backwards compatibility in older browsers runs faster than the actual ECMAScript style methods... I suspect this is because they actually use the classList Array, and Arrays/indexed objects are painfully JavaScript.


Latest Version: 0.9.56 RC 5.1, 21 July 2014