Check for the element before setting HTML on it.