Skip to content
Advertisement

select option created with var not displaying when adding a new field dynamically

I have a little problem here, when i add a new field the select option i created from var won’t show. I have tried a multiple method like changing from id into class, add a var option name into <select> in var html and it still doesn’t work. I suppose my JS nesting is the problem or something missing? If so any suggestion what code i must change or add here?

JavaScript
JavaScript
JavaScript

Feel free to add some code or change the code as your preferences

Advertisement

Answer

You can pass this inside your handleChange function where this refer to current select-box which is change then using that get other select-box reference and change values .

Demo Code :

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement