$(function(){ $(".tip").each(function(indx, element){ $(this).liTip({content:this.id + $(this).attr('def')+'<img......>'}) }); });