For example turning every <p>thing to assign id to</p>
in the document into <p id="something">thing to assign id to</p>
this is my first question so pls point out anything I should include
I have not tried anything yet because I dont know how to do it.
2
Answers
To literally answer your question, with the comment I made as a preface, you can grab all the p elements, filter for the ones with desired text, then change their ids using js.
I updated answer to add a class to the element instead of changing their id.
example:
It’s as simple as using the loop counter itself…
You’ll end up with IDs that look like… P0, P1, P2, P3, etc