跪求指点:mshtml::IHTMLElement,修改html标签属性
html如下
<center>
<input type="submit" value="提交" style="display:block" />
</center>
想要修改style="display:block" 为 style="display:none",是通过getAttribute和setAttribute来修改吗?
LPDISPATCH lpDispatch;
IHTMLElement* ipBody= NULL;
lpDispatch = GetHtmlDocument();
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> pDoc2;
HRESULT hr;
hr = lpDispatch->QueryInterface(IID_IHTMLDocument2, (void**)&pDoc2);
if (SUCCEEDED(hr))
{
pDoc2->get_body(&ipBody);
}
_bstr_t bstrName(_T("INPUT"));
_variant_t vtValue;
ipBody->getAttribute(bstrName, 0, &vtValue);
//这么写得不到啊。。。
求牛人指点...