I have following problem. After clicking on text I want to changing this text with input. After insert value in this input and press ENTER I want to returning input value.
I using this code but not worked after click enter :( :
$(document).ready(function() {
$('.qty_new').click(function(){
$(this).replaceWith("<input class='newVal' value='' />");
return false;
$('.newVal').keypress(function(e){
var qty=$(this).val();
var code =null;
code = (e.keyCode ? e.keyCode : e.which);
if (code == 13){
alert('ratata');
}
});
});
<span class='qty_new'>100</span>
Thanks in advance !