(function($){ $.fn.sliderTelepatic = function(target = false){ if(!target){ target = $(this).parent().find('label').find('span'); } $(this).on('change', function(item, i){ $(target).html( item.currentTarget.value + "%" ); }); } })(jQuery);