var txt = $( ".btn-split" ).text(); $( ".btn-split" ).attr("name", txt);