jQuery and similar libraries provide a number of useful APIs for DOM traversal and manipulation. Where your site as high number of repeat visitors, their use is easily justified as caching will offset any bandwidth cost to the end user.
In other cases visitors to the site might always be unique and thus the bandwidth penalty for these libraries can be too severe relative to the benefits for a development team.
Are there any libraries that provide this style of DOM interaction while allowing you to choose the parts relevant to your page.
For example,
jQuery('#myId').addClass('error');
and many other APIs in jQuery can be replicated in a few lines of code, thus avoiding ~50kB of downloads.
So the question is, does a library exist that contains these functions with little dependency on other aspects of the library or will I need to create them myself as necessary?
Are there mechanisms/tools available to break down existing libraries like jQuery into their minimal components?