Add id's to <p> using javascript or jQuery or Angular : I have a HTML document which is dynamically generated. It has a bunch of <p> tags which has text in it. I am trying to select the <p> when user clicks on that specific text. Unfortunately I am not allowed to add id's to the '<p>' tags which I could use to select the specific block of test. So I need to find a way to dynamically add id's to the <p> tags using javascript or jQuery or angular. 

I have seen some solutions which uses jQuery .attr("id", "newId") but it needs a selector and I don't know what to use as a selector. Can anyone suggest something.