It's not critical... but it might be shorter and cleaner to write smth like 
var img= $('<img>').attr( { src: 'enrty.icon', class:'icon'});
li.append(img);