Minor optimization - depend on tagName and type returning uppercase
Optimize search and jQuery.highlight