I am trying to create the append and delete input in jquery, my code is working perfectly but as I delete any input and try to again append the box it not working properly, and also autofocus in appended input not working.
I want to create as change the input value it will auto jump to the next box.
My code working fine but as I delete any row from that time it not working properly.
Please help How me achieve the goal and fix this issue permanently.
I don’t do jQuery but it seems to me that you could be removing the wrong element.
Find out what “this” is referencing when you invoke the remove function, it could be something different to what it is referencing in the if condition.
Use the developer tools to inspect the element.
There’s several problems with the code… (Reusing ID’s, primarily…)
Not sure why we’re using inline onclick instead of a delegated event…
Why are you calling init_input_focus inside a bound event created by init_input_focus? You’re going to bind the event multiple times that way.