如何更改整个元素 [英] How Do I Change Entire Element

查看:86
本文介绍了如何更改整个元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何更改整个div?

这是我的例子,

i创建了一个页面,它包含以下内容:

can some one please tell me how do i change the entire div?
here's my example,
i have created a page and it contains the following:

<div id='hello'>Div Hello</div>

<div id='hello2'>Div Hello2</div>



和我的VB或C#项目我想添加一个Webbrowser和Button,

当我点击该按钮时它改变了这个div:


and on my VB or C# project i want to add a Webbrowser and Button,
when i click on that button it changes this div :

<div id='hello'>Div Hello</div>

to make it disappear from the page or make it's style as block or none or something(what i mean is to remove that entire div only).

i have tried this on Visual Basic 2010 Express ut it only removes text not entire Div:

        Dim HTML As String
        HTML = "<div id="hello">Div Hello</div>"
        WebBrowser1.Document.Body.InnerHtml = ""

i really appreciate if some one help me please with some code or solution

Thank You.

推荐答案

你好伙计,



你可以写一个javascript函数,可以更新你的div。您可以调用webbrowser控件页面的javascript函数。



请查看本文从win表单中调用javascript:从WinForms调用JavaScript函数,反之亦然 [ ^ ]



如果您有任何疑问,请告诉我。 ...



快乐编码......
Hello buddy,

you can write one javascript function that can update your div. You can call javascript function of webbrowser control page.

Please check this article to call javascript from win form :Calling JavaScript function from WinForms and vice-versa[^]

Let me know if you have any query...

Happy coding...


这篇关于如何更改整个元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆