Direct replacement $("#locked").attr("src", "img/padlock.png");
$("#locked").attr("src", "img/padlock.png");
This adds an image directly to that div
theimage="",
$('#userimage').html(theimage)