delphi向webbrowser中写入新的html

procedure TForm1.btn1Click(Sender: TObject);
var
  doc:olevariant;
  str:string;
begin
    doc:=wb1.Document;
    //获取元素的值
    {str:=doc.all.xx.value;
    ShowMessage(str);}

    //写入htnl
    doc.clear;
    doc.write('<html><head></head><body><p>新的html</p><input type="hidden" value="0" id="xx" /></body></html>');
    doc.close;
end;

你可能感兴趣的:(delphi向webbrowser中写入新的html)