$(‘#demo‘).addClass(function(index,className){ return ‘red‘; })
03-对JQuery对象的属性,特性以及数据的操作
原文:http://www.cnblogs.com/focus1995/p/7256522.html