Calling TWebHTMLDiv.HTML.Clear calls this in Unit Core Source\WEBLib.WebCtrls.pas:
procedure THTMLDiv.UpdateElementData;
begin
inherited;
if Assigned(ElementHandle) and (FHTML.Text <> '') then
ElementHandle.innerHTML := FHTML.Text
else
begin
if not IsLinked and (csDesigning in ComponentState) then
RenderDesigning(ClassName, Container, Self, True);
end;
end;
As it checks for FHTML.Text <> '', in case FHTML was cleared, it does nothing. Hence, the DIV remains filled.
As a temporary fix, in addition to or instead of a .Clear, a HTMLDiv.HTML.Text = ' ' (a blank) will do.