javascript - Move around dynamic divs in blog post listings -


i working blog , want move category above title on each post listing. when use following code 50 clones of first category. think need using index parameter of .each() i'm not sure. here's code:

jquery(document).ready(function(){     jquery(".blog-category").each(function(){         jquery(this).insertbefore( jquery(".blog-head") ) ;     }); }); 

essentially i'm trying insert

.blog-category 

before

.blog-head 

on each post.

html

<div id="entry-2839">     <div class="blog-post-in">         <div class="blog-head">content</div>         <div class="blog-side">             <div class="blog-category">more content</div>         </div>     </div> </div> 

this should trick:

var e = jquery(this); e.closest(".blog-post-in").prepend(e); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -