I have the following input in HTML :
<div class="form-group">
<label for="siretNumber">Numéro de SIRET</label>
<input onkeyup="checkSIRET(this);" onfocusout="ocr_on_fly(true, this, true)" onfocusin="ocr_on_fly(false, this, true);" type="text" class="form-control" id="siretNumber" value="{{ pdf['siret'] }}">
</div>
<div class="form-group">
<label for="sirenNumber">Numéro de SIREN</label>
<input onkeyup="checkSIREN(this)" onfocusout="ocr_on_fly(true, this, true)" onfocusin="ocr_on_fly(false, this, true)" type="text" class="form-control" id="sirenNumber" value="{{ pdf['siret'] }}">
</div>
On the ocr_on_fly
function I need to automatically execute the function of the onkeyup
attributes. With the following code I get the value of the onkeyup
attr but how could I execute it then ?
let attr = input.getAttribute('onkeyup')
// attr = checkSIRET(this); or attr = checkSIREN(this);
Thanks in advance