私は次の入力のためにTabをクリックすると(コンテンツを動的に更新する関数があります)、次の入力のためのフォーカスを失った入力要素に変更関数をバインドします。jQueryを使用してTabキーを押した後でフォーカスを戻す方法は?
私は多くの方法を試みましたが、次の入力に焦点を当てることに失敗しました。
$(document).on("change", '.usdrate, .usdcost, ', function() {
updateinputs();
if($(this).attr('class') == 'usdrate'){
//not working
$('.usdcost').focus();
}
});
function updateinputs(){
//I create new inputs because I changed the values
//there are many operations here
$("#test").html('').html('<input class="usdrate"><input class="usdcost">');
}
html code:
<div id="test"><input class="usdrate"><input class="usdcost"></div>
を、私は答えを追加した、しかし、私は何を知っていない。ここ
は、構文エラー
フィドルですこの行の意味です "$(document).on(" change "、" .usdrate、.usdcost、 '、function() "それは間違っているはずです –