function plain_view(){ window.styles = ''; $('.edit_style').each(function(){ window.styles = window.styles+"\n"+ $(this).attr('data-ident')+' { '+$(this).attr('data-edit')+': '+$(this).val()+'; }'; }); alert(window.styles); }