Hi,
In my application developing using VB .Net, i want a create HTML elements dynamically. I want to create as given below ,
For the above, i have written code like this,
The above code works fine. Now how do i append a img element. Also how do i mention the class ?
Any help will be highly appreciated.
Thanks,
Dev.
In my application developing using VB .Net, i want a create HTML elements dynamically. I want to create as given below ,
Code:
<div class="contact"> <dl class="user"> <dt> <img class="onicon" title="Online" alt="Online" src="var/images/spacer.gif"/> </dt> <dt class="photo"> <img class="usimg" title="Photo" alt="Photo" src="var/images/user.gif"/> </dt> <dd>aaa</dd> <dd class="statusmsg">Available</dd> </dl> </div>
Code:
Public WithEvents htDoc As HtmlDocument Public WithEvents div As HtmlElement Public WithEvents dd1 As HtmlElement Public WithEvents dd2 As HtmlElement htDoc = WebBrowser1.Document div = htmlDoc.CreateElement("DIV") dd1 = htmlDoc.CreateElement("DD") dd2 = htmlDoc.CreateElement("DD") dd2.InnerHtml = "----------------------------------" dd1.InnerHtml = "TTTTTTTTT" div.AppendChild(dd1) div.AppendChild(dd2) htDoc.Body.AppendChild(div)
Any help will be highly appreciated.
Thanks,
Dev.
Comment