jQuery 1.5 beta1 のリリースノートを見ていたら面白そうな機能があったので紹介。 jQuery.subclass() でjQueryのサブクラスを作ることができる var MyjQuery = jQuery.subclass(); 作成したサブクラスには独自のメソッドを定義することができる。定義の仕方、使い方は通常のjQueryと全く同じ。 MyjQuery.fn.writeHello = function(){ this.text('Hello World'); }; MyjQuery('p').writeHello(); 通常のjQueryメソッドはサブクラスでもそのまま使える。サブクラスを作った後に追加したメソッドも使えるので、プラグインによる拡張と組み合わせても大丈夫。 MyjQuery('div').css('border', '1px red solid').wr