Javascript Jquery函数应该与子类一起使用,而不是所有类
A有一个jquery函数Javascript Jquery函数应该与子类一起使用,而不是所有类,javascript,jquery,this,subclass,Javascript,Jquery,This,Subclass,A有一个jquery函数 $(".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'));
$(".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'));
});
});
此函数只需用于子类current.Rolld wrap(例如,Rolld wrap(this).button文本范围)。。。。。但是,单击一个类,结果为所有。按钮文本span。。。。我不知道该怎么办,我将感谢任何帮助。提前感谢您要查看目标元素内部,请使用
.find()
是的,伙计。。。堆叠我写你可以接受在8分钟内)你回答正确我一定会注意到你的答案)我很抱歉新手
$(".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'));
});