procedure TForm1.FormCreate(Sender: TObject);
begin
webbrowser1.Navigate('d:/temp.htm');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
x,y:variant;
begin
x:=webbrowser1.Document ;
y:=x.all.tags('A');
x:=y.item('AA');
x.onclick;
end;
D:/temp.htm
<HTML>
<HEAD></HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
function goto()
{
alert('Clicked!!!');
}
//-->
</SCRIPT>
<A href=# id=AA onclick='goto()' >aaa</a>
</BODY>
</HTML>