jQuery能做些什么

来源于: Learning jQuery, 4th Edition

What jQuery does:

1. Access elements in a document;

$('div.content').find('p');

 

2. Modify the appearance of a web page;

$('ul>li:first').addClass('active');

 

3. Alert the content of a document;

$('#container').append('<a href="more.html">more</a>');

 

4. Respond to a user's interaction;

$('button.show-details').click(function(){

$('div.details').show();

});

 

5. Animate changes being made to a document;

$('div.details').slideDown();

 

6. Retrieve information from a server without refreshing a page;

$('div.details').load('more.html #content');

 

7. Simplify common JavaScript tasks: 

$.each(obj,function(key,value){

total +=value;

});

posted @ 2016-12-09 14:32  一个勤奋的胖子  阅读(430)  评论(0编辑  收藏  举报