Answer the question
In order to leave comments, you need to log in
Changing content in only one div block, in js?
There is such a JS code that changes the price when you select the desired select.
$('.options select').change(function() {
var option = $(this).children('option:selected');
$('.price .price-new').html(option.data('new_price'));
$('.price .price-old').html(option.data('old_price'));
if (option.data('new_price') == option.data('old_price')) {
$('.price .price-old').html('');
};
});
<span class="price-new"><?php echo $product['special']; ?></span>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question