Buongiorno.

Ho il seguente javascript che agisce su un select con class select
codice:
$('select.select').each(function(){
	var title = $(this).attr('title');
	if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
	$(this)
		.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
		.after('<span class="select">' + title + '</span>')
		.change(function(){
			val = $('option:selected',this).text();
			$(this).next().text(val);
		})
	});
io avrei bisogno di uno script più flessibile, nel senso che al posto di .after('<span class="select">' + title + '</span>') vorrei mettere la classe uguale al name (o all'id) del select...
come posso fare?