【誰か】jQueryのここがわからない【助けて】at TECH
【誰か】jQueryのここがわからない【助けて】 - 暇つぶし2ch327:デフォルトの名無しさん
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が存在しないのがいけないのかと。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch