Your problem is a scope switch. So inside the setInterval loop "this" will no longer refer to your jQuery object but rather to the "window" object. A workaround would be to store the reference and use this temporary variable instead of "this" inside setInterval
Code:
(function($){
$.fn.textAnim = function(text,speed){
var progress = 0;
var that = this;
var a = setInterval(function(){
progress++;
$(that).html(text.substring(0,progress));
if(progress == text.length){
clearInterval(a);
}
},speed);
};
})(jQuery);