/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('body').append('<div id="writehere"></div>'); $('div,span,img').each(function (index, elem) { var thatstuff = $(this).attr("id"); var thisstuff = $(this).attr("class"); if(thatstuff!='writehere'){ if(thatstuff!=''){$('#writehere').append('#'+thatstuff+' {\n\n}\n\n');} if(thisstuff!=''){$('#writehere').append('.'+thisstuff+' {\n\n}\n\n');} } });