Home  >  Article  >  Web Front-end  >  Correct use of jquery chain operations_jquery

Correct use of jquery chain operations_jquery

WBOY
WBOYOriginal
2016-05-16 17:05:111203browse

Bad usage

Copy code The code is as follows:

$second.html( value);
$second.on('click',function(){
alert('hello everybody');
});
$second.fadeIn('slow');
$second.animate({height:'120px'},500);

Recommended usage

Copy code The code is as follows:

$second.html(value );
$second.on('click',function(){
alert('hello everybody');
}).fadeIn('slow').animate({height:'120px' },500);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn