jQuery更改多个属性或替换整个html

我想知道用jQuery更改多个属性是否更有效/更快,或者只是一次更换所有的html。这是我目前使用的代码
// shows the table and changes the image to up
showTable = function(tableId){
    $('#img' + tableId).attr("src",images["up"]).attr("alt","Hide Table").attr("title","Hide Table");
    $('#' + tableId).fadeIn(250);
}

还是会更快?

// shows the table and changes the image to up
showTable = function(tableId){
    $('#img' + tableId).replaceWith('some html');
    $('#' + tableId).fadeIn(250);
}

解决方法

$('#greatphoto').attr({
  alt: 'Beijing Brush Seller',title: 'photo by Kelly Clark'
});

示例取自jQuery Documentation

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...