How to change text to input with jQuery? (and back)

How to change text to input with jQuery? (and back)

Hello,

I wonder how to let a small text snippet change to an input box with as value the small text snippet when you just clicked on. When you click out, or press enter, the new text has to have the value of the input?

There is a list of data from the database. I would like an input box to appear when users click on a list item (text) and the input box has the value of the list item and users are ofcourse be able to change this value. The value has to be 'selected'. When users click back outside the inputbox OR on another list item (where a new input box appear with value of that particular list item) OR press enter, the value of the input box has to be written to the database.

Does anybody know how to do this with jQuery? :)

thx!

Christophe