var result = $('#target').text(); $('#' + result).css({'background' : 'black', 'color' : 'white'}).text('me');