I need to simulate a click, and send the value of an element. This is because the item I need to click exists several times on the page with the same ID, but I only want trigger the behavior of one.
The element looks like this
<input type="submit" value="Login" class="um-button" id="um-submit-btn">
My code so far is
$("#user_password-36").on('keyup', function (e) {
if (e.keyCode == 13) {
$("#um-submit-btn").click();
}
});
But I think I need to be able to send the value, which is 'Login'. Otherwise it triggers the wrong submit button.
I appreciate this is not a good solution, but I need to make this work without modifying the existing code that runs the login system.