jQuery Plugin insertAt() For Comparator-Based Insertion
Updated: 2011-06-30 17:03:00
When creating or augmenting user interfaces with JavaScript, I often find myself in a situation where I have to insert a new DOM element into a collection of existing DOM elements based on some sort of comparison. Sometimes the target of this comparison is the text() value of the given nodes; more often it's a custom data attribute. In either case, I have to iterate over the target collection in order to determine where the new DOM element needs to be inserted. This task always feels more com ... ead More raquo;