function updateSource(source, src) { source = $(source); source.attr("src", src).appendTo(source.parent()); }