OK.
got this AJAX code:
and this js in the same page:
this js works OK but it seems to me that the js runs first and then the AJAX code and this last one erases the text I changed and puts its own and I want to do the opposite.
Hope I made it clear now. Sorry but English is not my native language.