たまに、jQueryはXPathのセレクタ使えるというエントリーを見かけますが、CSSのセレクタの間違いです。 例えば、idがhogeの要素を取得する場合 #hoge が CSS id("hoge") が XPathで、XPathを使いたいなぁと思っていたところ、 id:amachangさんがJavascript-XPath作ってた事を思い出し、使ってみた。XPath for jQueryと併用して、いざページ開いたら、 javascriptエラーが、"XPath for jQuery"の方でエラーになるみたいなので、ソース確認。 要は、関数の拡張なので、jQuery.extendとjQuery.fn.extendでいけるのでは?と素人考えで変更したらうまくいきました。 // type is String or Number or Booleaen or Array or undefine