CreateElement in c#

  • Автор темы Автор темы mrjozo
  • Дата начала Дата начала

mrjozo

Новичок
Регистрация
26.08.2015
Сообщения
5
Реакции
0
Баллы
1
Hi,

noticed that CreateElement is private and can't invoke it. Is it possible to create new html element in c# and put in to document? So far I've created html code in c# returned it to variable and then set it with zp block set innerhtml. But wondering if I can do this directly in c#?
 
You can change innerhtml of element via C# (add whatever you want there)
 
yYvKnTP.png


C#:
Развернуть Свернуть Копировать
// find element using "text" parameter
HtmlElement he = tab.MainDocument.FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
if (he.IsVoid) return -1;
// set innerhtml
he.SetAttribute("innerhtml", "New Innerhtml");
 
Thanks. I doesn't try SetAttribute for innerhtml because it's rather property not attribute due to w3 spec
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)