using singleton to replace $(this)
Hi:
I hope to implement an singleton to replace the usage of $(this); following is my code snippet
- jQuery.single = (function (element) {
- var collection = jQuery([1]);
- return function (element) {
- collection[0] = element;
- return collection;
- };
- });
- $('#btnTestSingle').bind('click', function () {
- var html = jQuery.single(this).next().html();
- console.log(html);
- return false;
- });
however the error message show the next() is not a function.
Is there any instruction can help to fix that, thanks a lot.