It does not work for me to add dynamic option in Chrome

0

This is my first time here since I am learning more in depth the subject of programming. I have a problem that is that I have a select with dynamically added options, but only the MOZilla is displayed well, in Chrome they are not displayed, but when you inspect them, I leave more or less the cod:

<script>

    $.getJSON("kits.json", function (kitjson) {

                    for (i = 0; i < kitjson.kits.length; i++) {

                        var valorKitname = kitjson.kits[i].kitname
                        var x = document.getElementById("selectKit");
                        var option = document.createElement("option");
                        option.text = valorKitname;
                        x.add(option);

                    }
                });
</script>

 <select id="selectKit"  >
                <option>Mustard</option>
                <option>Ketchup</option>          
 </select>

If anyone knows I would appreciate it! Successes!

    
asked by Juan Manuel Pasquali Juanpasq 16.04.2018 в 19:00
source

0 answers