I need to make a simulated click on input field using javascript in browser console. The site isn't mine.
I use the code:
document.getElementById('bets-stake-amount-1').click();
I have to click the element with this ID: bets-stake-amount-1
.
I think that only option is to click with mouse button.
I have tried to change the type of the field but it not work.
<div class="bet p-1 ng-star-inserted">
<div class="bet-icons pull-right">
<a class="bet-remove ng-star-inserted">
<span class="fa fa-times" title="Rimuovi">
</span>
</a>
</div>
</div>
<div class="combis mt-2 mb-2">
<app-betslip-input grouping="1" class="ng-star-inserted">
<div class="radio p-1 ng-star-inserted">
<div class="flex-row">
<div class="input-group flex-col-7">
<input autocomplete="off" class="form-control text-right" tabindex="1" type="text" id="bets-stake-amount-1" readonly="">
<span class="input-group-addon ng-star-inserted">€
</span>
</div>
</div>
</div>
</app-betslip-input>
</div>
The output is undefined
.