简体   繁体   中英

JS appendTo element

Hi please can anybody help me? I have a problem with finding propper Jquery to prependTo a element into his sibling.

在此处输入图片说明

But after I type this:

$(document).ready(function(){
    var place = '.portfolio_item_hover .item_info span.price';
$('.quant a.button').prependTo(place);

});

在此处输入图片说明

Please can anybody help me with code I have to type.

Hoodie with Pocket 45.00€ 35.00€ Pridať do košíka

try this:

 $(document).ready(function(){ var $place = $('.portfolio_item_hover .item_info span.price'); var $elementToPrepend = $('.quant a.button'); $elementToPrepend.prependTo($place); }); 

<div class="quant col-md-4 col-sm-6 hoodies-clothing " style="position: absolute; left: 0px; top: 0px;">
            <a id="64" class="portfolio_item wow fadeInUp" href="http://piso.seduco.sk/produkt/hoodie-with-pocket/" title="Hoodie with Pocket" style="visibility: visible; animation-name: fadeInUp;">
                <img src="./piso.seduco.sk_files/hoodie-with-pocket-2.jpg" alt="image" class="img-responsive"> 
                <div class="portfolio_item_hover">
                    <div class="item_info">
                        <span>Hoodie with Pocket</span>
                        <span class="price"><del><span class="woocommerce-Price-amount amount">45.00<span class="woocommerce-Price-currencySymbol">€</span></span></del> <ins><span class="woocommerce-Price-amount amount">35.00<span class="woocommerce-Price-currencySymbol">€</span></span></ins></span> 
                    </div>
                </div>
            </a>
            <a href="http://piso.seduco.sk/?add-to-cart=64" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="64" data-product_sku="woo-hoodie-with-pocket" aria-label="Add “Hoodie with Pocket” to your cart" rel="nofollow">Pridať do košíka</a>
        </div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM