This is an edit function like in CRUD system, but the idea is to simplify whereby when the user by using single or double click on an item, it will be turned into a field to directly update the data..
Demo here
The problem is I can't type anything into the field, I wonder why...
Html
<li style="list-style:none">click here to edit</li>
jquery
$(document).ready(function(){
$('li').click(function(){
$(this).html("<input id='input' type='text'>");
});
$('#input').blur(function(){
var newVal = ('#input').val();
$('li').text('newVal');
});
});