コードは次のとおりです。
$("input[type='text']").on('input', function() { ...stuff here... }); //first function
$('input[type="text"]').click(function() { //second function
$('#keyboard').show();
$('#keyboard .letter').click(function() {
var currentValue = $('input[type="text"]').val();
alert(currentValue);
$('input[type="text"]').val( currentValue + $(this).text() );
});
});
短いバージョンでは、このテキスト入力を入力すると、top関数が起動します。2番目の関数では、キーボードを表示し、ユーザーのクリックに基づいて入力の値を変更します。ただし、2番目の関数を使用して入力値を変更した場合、最初の関数は実行されません。何か案は?とても有難い。