The situation is this: there are 2 selekta, in the first type of machine, in the second model of the machine. The values ββin the second select change depending on the selection in the first select. When choosing in the second selection, the picture of the car model should change, but I cannot figure out how to do it.
Here is the code:
var mkLists = new Array(4) mkLists["empty"] = ["ΠΡΠ±Π΅ΡΠΈΡΠ΅ ΠΌΠ°ΡΠΊΡ ΠΌΠ°ΡΠΈΠ½Ρ"]; mkLists["passenger"] = ["Hyundai", "Toyota Camry 40", "KIA Optima"]; mkLists["BusinessClass"] = ["Toyota Land Cruiser", "Mercedes-Benz S 350-l", "Mercedes-Benz S 500-l", "KIA Cadenza", "Ssangyong Chairman Limo"]; mkLists["Multiplace"] = ["Mercedes Benz Tourismo", "Hyundai Aero City", "Hyundai Universe Luxury", "Hyundai Counti", "Toyota Coaster", "Toyota hiace"]; mkLists["SpecMachinery"]= ["ΠΠ°Π· 330232", "ΠΠ°Π· 330202", "ΠΠ°ΠΌΠ°Π· 45143", "ΠΡΠΈΡΠ΅ΠΏ (ΠΠ°ΠΌΠ°Π· 45143)"]; function mkChange(selectObj) { var id = selectObj.selectedIndex; var which = selectObj.options[id].value; carsList = mkLists[which]; var carSelect = document.getElementById("brand"); while (carSelect.options.length > 0) { carSelect.remove(0); } var newOption; for (var i=0; i<carsList.length; i++) { newOption = document.createElement("option"); newOption.value = carsList[i]; newOption.text=carsList[i]; try { carSelect.add(newOption); } catch (e) { carSelect.appendChild(newOption); } } //ΠΊΠΎΠ½Π΅Ρ ΡΠΈΠΊΠ»Π° } //ΠΊΠΎΠ½Π΅Ρ ΡΡΠ½ΠΊΡΠΈΠΈ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form> <select id="mk" onchange="mkChange(this);"> <option value="empty">ΠΡΠ±Π΅ΡΠΈΡΠ΅ ΡΠΈΠΏ ΠΌΠ°ΡΠΈΠ½Ρ</option> <option value="passenger">ΠΠ΅Π³ΠΊΠΎΠ²ΠΎΠΉ</option> <option value="BusinessClass">ΠΠΈΠ·Π½Π΅Ρ ΠΊΠ»Π°ΡΡ</option> <option value="Multiplace">ΠΠ½ΠΎΠ³ΠΎΠΌΠ΅ΡΡΠ½ΡΠΉ</option> <option value="SpecMachinery">Π‘ΠΏΠ΅ΡΡΠ΅Ρ
Π½ΠΈΠΊΠ°</option> </select> <select id="brand"> <option value="0">ΠΡΠ±Π΅ΡΠΈΡΠ΅ ΠΌΠ°ΡΠΊΡ ΠΌΠ°ΡΠΈΠ½Ρ</option> </select> </form> <img src=""> If any ambiguities - ask. Thank you in advance