如何检查Id = “SomeID”的元素p中的“某些文本值”是否存在?
<p id="SomeID" class="error" style="display: none"></p>
<p id="SomeID" class="error" style="display: none">Some text value</p>
这里是函数形式..
function ElementIdText(Web:TembeddedWB; Id:string):string;
var
node: string;
begin
if Assigned(Web.Document) and web.DocumentLoaded then begin
node:=Web.OleObject.Document.GetElementByID(Id).innerText;
if not VarIsNull(Node) and not VarIsClear(Node) and not AnsiSameStr(node,'') then
result:=node;
end;
end;