I wrote the following script:
<input type="password" class="email password_action" placeholder="Account Password" id="user_password" name="user_password" required>
<? for($i=0; $i<=9; $i++){ ?>
<button id="keyboard_<?=$i;?>" class="btn btn-default" type="button" value="<?=$i;?>"><?=$i?></button>
<script language="javascript">
$(document).ready(function() {
var valueKey = $('#keyboard_<?=$i;?>');
valueKey.click(function(){
//$("#user_password").attr("value",valueKey.val());
$('#user_password').append($('#user_password').attr(valueKey.val()));
alert(valueKey.val());
});
});
</script>
<? } ?>
But when you click the button that refers to the number to enter the password, it does not add to the password field.
How do I do that by clicking on any of the numbers displayed inside the for, add the value of the button to the input?