0

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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>");//how to access and prepand //to each selected divs..
                });
bayyinah
  • 139
  • 1
  • 3
  • 12

1 Answers1

1

Yes, it's the same as .Cq() in newer versions of CsQuery. IDOMElements have a .Cq() extension method that does it.

 domEl.Cq().Text(); // for example
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504