One way to do this would be to store the value in a closure like this:
(function () {
var value = 0;
$.widget('my.plugin', {
_create: function () {
value++;
},
getValue: function () {
return value;
}
});
})();
$('.element').plugin();
$('.second-element').plugin();
$('.element').plugin('getValue'); // 2