I was wondering if it were more efficient/faster to change multiple attributes with jQuery or to just change replace all the html in one go. This is the code i am using at the moment.
// 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);
}
or would this be faster?
// shows the table and changes the image to up
showTable = function(tableId){
$('#img' + tableId).replaceWith('some html');
$('#' + tableId).fadeIn(250);
}
Example taken from jQuery Documentation.