0
I need to create a mask to hyphenate the penultimate number, automatically, as long as it has at least 5 characters, in a bank account input, using pure JS. Thus: xxxx-x | xxxxx-x | xxxxxx-x.
<div class="form-group" align="center">
<label for="cc-nome">Número da conta</label>
<input type="text" class="line-animation" placeholder="" name="conta" value="0000-0" required>
<div class="line"></div>
</div>