var doc:IHTMLDocument3;select1:IHTMLSelectElement; v:OleVariant; disp:IDispatch; Option:IHTMLOptionElement; begin doc:=(WebBrowser1.Document as IHTMLDocument3); select1:=doc.getElementById('select1') as IHTMLSelectElement; v:=select1.selectedIndex ; disp:=select1.item(v,v); if disp=nil then exit; Option:=disp as IHTMLOptionElement; ShowMessage(Option.text);
查查DHTML的帮助。
我用ole.text的时候说不支持这个方法啊
那里有DHTML的帮助啊??MSDN98里面有么>
兄弟,你的代码也不行啊
ole.selectedIndex
不过这句能够返回选择的索引值那里有资料可以查看到OLE带了什么属性的啊??
**=document.forms[0].name.options[i].text;
试一下行不……
text的这个属性,所以很郁闷
不知道有什么办法来解决才好啊
你变通一下,用脚本取,存个地方,再用delphi取不完了……
javascript也取不到,而且脚本不能操作硬盘
兄弟:难道你要我用JS的东东来取那个东西???
v:OleVariant;
disp:IDispatch;
Option:IHTMLOptionElement;
begin
doc:=(WebBrowser1.Document as IHTMLDocument3);
select1:=doc.getElementById('select1') as IHTMLSelectElement;
v:=select1.selectedIndex ;
disp:=select1.item(v,v);
if disp=nil then exit;
Option:=disp as IHTMLOptionElement;
ShowMessage(Option.text);