.text() resulting in redundant text

.text() resulting in redundant text

So i'm trying to implement an edit comments functionality :

There's a p tag. I click on it and change the comment on it and click on a button . On the button click i'm trying to get the newly edited text. But it gives a result where in the old text is appended to the newly edited text .