これを別の .js ファイルに書き、HTML に添付しました。
(function ($) {
    $.fn.test = function(){
        this.remove();
        return this;
    };
}(JQuery));
次に、私の html の別の .js ファイルで使用しました:
$("#table").test();
しかし、このエラーが表示されました:
Uncaught TypeError: Object [object Object] has no method 'test' 
何が問題なのかわからない!