Swap from text to input on double click

How would I change a table cell content from displayed text to a text input form field by double-clicking on the text?

Have a look at http://vitalets.github.io/x-editable/. An update for Bootstrap 4 is available from https://github.com/Talv/x-editable/tree/develop/dist/bootstrap4-editable/css

Thank you, that seems to be exactly what I want.