With a JQuery GET request, I'm generating Google Authenticator secret (this part works fine). After the Secret has been generated, I'm hiding the generated ID and display the one time password for submit. Inside the one time password, I have a button. Now I do a simple alert to test the button but this button is not working. Can anyone let me know what I'm doing wrong in my JQuery script:
$( "#enable_authenticator" ).click(function() {
$.get("{{route('generateSecret')}}",
function(data, status){
$('#Authenticator_alert').hide();
$('#enable_authenticator').hide();
$( "#set_authenticator" ).html('<center>'+data[0]+'<br>'+'Your Authenticator Secret is: <strong>'+data[1]+'</strong> <br> <input type="text" placeholder="One Time Password" id="onetimepassword" class="form-control"><br> <button type="button" id="submitOneTimePassword" class="btn btn-warning">Submit</button></center>');
});
});
$('#submitOneTimePassword').click(function() {
alert('here');
});
ID: submitOneTimePassword is not working.