Reputation: 3
A have a this jquery function....
$(".rolled-wrap").on('click', function() {
$(this).each(function() {
$('.button-text span').text($('.button-text span').data('hover'));
$('.button-text span').attr("data-hover", $('.button-text span').data('hover'));
});
});
this function need working only for subclasses, current .rolled-wrap (e.g. .rolled-wrap (this) .button-text span)..... however clicking on one class, result summbit for all .button-text span.... I do not know what to do, I will be grateful for any help. thank you in advance
Upvotes: 0
Views: 31
Reputation: 6512
To look inside the target element use .find()
$(".rolled-wrap").on('click', function() {
$(this).find('.button-text span').text($('.button-text span').data('hover'));
$(this).find('.button-text span').attr("data-hover", $('.button-text span').data('hover'));
});
Upvotes: 1