<div id="name">Click me!</div>
<script src='https://code.jquery.com/jquery-latest.js'></script>
<script>
$("#name").click(function() {
$(this).replaceWith('<input type="text" name="correct_name" id="cor_name" value="33" size="30">');
$("#cor_name").keyup(function(){
changed_name = $(this).val();
if (event.keyCode == 13) {
alert(changed_name);
}
});
});
</script>