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.
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: