Method for selecting elements in Sizzle using fully-qualified URLs
问题 While working on a script recently, I came across a peculiar nuance of how Sizzle works with the href attribute. Specifically, using an attribute selector on an href , Sizzle will use the actual attribute value: // Will not find <a href="index.html">... $('a[href="http://www.example.com/index.html"]') Sizzle uses .getAttribute() instead of elem.href (or more precisely, elem['href'] , as Sizzle does in most cases); elem.href would provide the fully-qualified URL. To understand this a bit more,