Reputation: 139
is there equivalent for $(this) in csquery.. in below example letterbody string has html content. i want to prepand text before each tag.
var dom = CQ.Create(letterBody);
CQ divs = dom.Select("p");
divs.Each(
(index, domCQ) =>
{
index = index + 1;
divs.Prepend("<span>" + index++ + "</span><span> </span>");//how to access and prepand //to each selected divs..
});
Upvotes: 0
Views: 86
Reputation: 276306
Yes, it's the same as .Cq()
in newer versions of CsQuery. IDOMElement
s have a .Cq()
extension method that does it.
domEl.Cq().Text(); // for example
Upvotes: 1