.html() When .html() is used to set an element's content, any content that was in that element is completely replaced by the new content. Additionally, jQuery removes other constructs such as data and event handlers from child elements before replaci…
JQuery处理DOM元素-属性操作 //操作元素的属性: $('*').each(function(n){ this.id = this.tagName + n; }) //获取属性值: $('').attr(''); //设置属性值: //为一个属性设置值 $('*').attr('title', function(index, previousValue){ return previousValue + ' I am element ' + index + ' and my name is…