Execute JavaScript DOM with .NET

I have an HTML string that contains JavaScript code in the <script> tag. This string is passed to a C# program. I’ve read a lot about executing JS in C# (Jint, etc.), but I haven’t found a solution with which I can apply commands to the DOM part.
In general, JS will be composed before applying certain styles to HTML elements, and I plan to remove all JS from the string after its execution. Maybe there are alternatives to the solution?

Executing JS DOM in a C# program