skip to Main Content

Can't add onkeydown attribute to dynamically created input – Html

HTML: <form id="form"> <div class="form-group" id="df2"> <input type="text" class="form-control" name="atribut[]" onkeydown="changeIt(event)"> </div> <div class="form-group" id="inputs"> </div> </form> changeIt function: <script> let div = document.getElementById("df2"); let inputs = document.getElementById("inputs"); function changeIt(event) { var key = event.which || event.keyCode; if (key ==…

VIEW QUESTION
Back To Top
Search