-1

3 つの入力があります (JqueryMobile のオートコンプリート)。この関数の使用:

$('.ui-input-clear').attr('onclick', 'delete_email();');

各クリアボタンに onclick イベントを追加しましたが、同じボタンの入力のみを削除するにはどうすればよいですか?

例:

[<------INPUT------>]  [BUTTON] //If I click, the value of THIS input turns ""

[<------INPUT------>]  [BUTTON] //If I click, the value of THIS input turns ""

[<------INPUT------>]  [BUTTON] //If I click, the value of THIS input turns ""
4

2 に答える 2

0
$(document).ready(function(){
$('.ui-input-clear').click(function(){
   $(this).prev().find('input').val('');
});
});
于 2013-04-22T09:53:39.723 に答える