Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery函数应该与子类一起使用,而不是所有类_Javascript_Jquery_This_Subclass - Fatal编程技术网

Javascript 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'));

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'));
    });
}); 

此函数只需用于子类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'));
});