HTML replacement

Hi guys,

I’m trying to do a proof of concept on something and can’t find a good example of how to do it with the HTMLRewriter

Basically within my HTML (that I can’t change) I have this line
Reference

It is unique so I’d like to specifically target it and replace the “Reference” with “Order Number”

I assumed I’d have to use a selector like label[for=‘Order’] and then setInnerContent(“Order Number”) but no matter what I try, I can’t get it to work (which is more of a reflection on me…)

Are there any good examples of someone doing something similar or any pointers? I tried the links example but the attribute targeting I couldn’t make work

As that’s a Workers feature. I bet some of the Workers fanatics on Discord can help: