I have my li, it has the option for editing the name. But each time I add a new element dynamically, I can't not change the name. The action for changing the name is not fire.
Having my code this way. I read on the jquery documentation about event delegation I thought this was the best way for solving this issue, But I'm implementing it the wrong way. Any idea how it's?
This is a demo of what I have: http://jsfiddle.net/DiegoTc/vK588/10/
<li id="cZero" class="active">
<a href="#tab_preview" data-toggle="pill">
<span class="display edit_text">Preview Card</span>
<input type="text" class="edit" style="display:none"/>
</a>
</li>
$(".edit_text").on('dblclick', function(event){
event.preventDefault(event);
$(this).hide().siblings(".edit").show().val($(this).text()).focus();
});
$(".edit").focusout(function(){
$(this).hide().siblings(".display").show().text($(this).val());
});