私は、最後の行が終了した後に再び呼び出す関数を持っています。内部で関数を呼び出す方法
コードを表示した方がわかりやすいかもしれません。
function updateQuantity(){
// further code where I change same data
// and now I want to start function again but with remembering the input element that called it previously
updateQuantity(this); // I tried it this way but it doesn't work
}
それはどうしたらうまくいかないのですか?これは典型的な再帰のケースです(終了条件が必要な場合を除く)。もう一度呼び出すときに同じ「this」値を持つようにしていますか? –
@MikeC OPは 'updateQuantity'の以前の実行で設定された変数を保存しようとしていますか? – andlrc
私はこの関数で使用したい入力要素を覚えておきたいです – cyprian