javascript - jQuery pre/append only within parent class name -


i have page lots of repeated items (a list of hotels)

i'm using optimizely , i'm trying move elements around in each hotel.

every time pre or append moves every element every hotel every element.

so i'm trying pre/append class name class name if it's in parent of class name.

the class name of each hotel .hotel:

$('.rating').prependto(function(){         $(this).parents('.hotel').prependto('.price-tag'); }); 

this isn't working, appreciated

i think want rating prepended price-tag element within current hotel, in case

$('.rating').each(function () {    $(this).closest('.hotel').find('.price-tag').prepend(this); }); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -