Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/458.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_Css Selectors - Fatal编程技术网

Javascript jQuery:$(';元素';什么的)?

Javascript jQuery:$(';元素';什么的)?,javascript,jquery,css-selectors,Javascript,Jquery,Css Selectors,可能的重复项: 任何人都知道什么是: $('element', $$).function(){...}; () 及 () ?它使用this或$$作为上下文,即返回的所有元素都必须是其子元素。默认值为文档 $('.pblabel', this).text(newVal + '%'); 是同一件事吗 $(this).find('.pblabel').text(newVal + '%'); 事实上,这就是它被重写并在内部运行的方式。它被称为“上下文选择器” 从: 您还需要哪些信息?可能与文

可能的重复项:


任何人都知道什么是:

$('element', $$).function(){...};
()

()


它使用
this
$$
作为上下文,即返回的所有元素都必须是其子元素。默认值为
文档

$('.pblabel', this).text(newVal + '%');
是同一件事吗

$(this).find('.pblabel').text(newVal + '%');
事实上,这就是它被重写并在内部运行的方式。它被称为“上下文选择器”

从:


您还需要哪些信息?可能与文档中的and.重复:“在内部,选择器上下文是通过.find()方法实现的,因此$('span',this)相当于$(this).find('span')。@FelixKling:建议中没有提出这些信息。可能与@GG重复。不,它可以是任何变量<代码>$在变量和函数名中有效(因此jQuery的主
$
函数)。
$(this).find('.pblabel').text(newVal + '%');
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
    return ( context || rootjQuery ).find( selector );

// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
    return this.constructor( context ).find( selector );
}