10/10/29 22:48:49
>>323
<div class="editable">this is editable</div><br />
<div class="editable">this is editable</div><br />
<script>
$(function(){
var editableFunc = function()
{
var $editable = $(this);
$editable
.unbind('click', editableFunc)
.html('<input type="text" value="' + $(this).text() + '" /><button type="button">決定</button>')
.find('button').click(function(e){
e.stopImmediatePropagation();
$editable
.html($editable.find('input:first').val())
.click(editableFunc)
})
}
$('.editable').click(editableFunc);
})
</script>
多分、$('#change').click()設定時に#changeが存在しないのがいけないのかと。