Posted By

jackkeller on 11/01/11


Tagged

jquery


Versions (?)

Auto CSS Skeleton from #id's


 / Published in: JavaScript
 

  1. $('body').append('<div id="writehere"></div>');
  2. $('div,span,img').each(function (index, elem) {
  3. var thatstuff = $(this).attr("id");
  4. var thisstuff = $(this).attr("class");
  5. if(thatstuff!='writehere'){
  6. if(thatstuff!=''){$('#writehere').append('#'+thatstuff+' {\n\n}\n\n');}
  7. if(thisstuff!=''){$('#writehere').append('.'+thisstuff+' {\n\n}\n\n');}
  8. }
  9. });
  10.  

Report this snippet  

You need to login to post a comment.