Мне было интересно, было ли более эффективно / быстрее изменить несколько атрибутов с помощью 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);
}