私はモーダルフォームを持っています:
<button class="float-right" type="submit">Login</button>
<div class="block-footer align-right">
<button type="button">Submit</button>
<button type="button">Submit & Close</button>
<button type="button">Close</button>
</div>
ユーザーがEnterキーをクリックしたときに、最初の「送信」ボタンが「クリック」されるようにするにはどうすればよいですか。クリックするとボタンの色が変化するのをユーザーに視覚的に見てもらいたいので、クリックアクションにとって重要です。
私はすでに次のことを行い、関数の実行をそのボタンに関連付けていることに注意してください。
$('#modal button:contains("Submit")').click(function () {
submitHandler(dObj.$link, $('#main-form'), false);
});