There are related drop-down lists and in the second list, the class assigned to the first one. How to make the js script run only for a certain class value? These 2 codes (drop-down list and JS code with the output of the current date) are individually all workers. I also need to make a link so that if I select a specific value in the second drop-down list (let's say with class="chiv" ), then 2 (which is JS) the code started to work and output its picture (as a result, it should show two images, one from the drop-down list and one from JS code). If with another class, then the JS code would simply be skipped.
<select id="programming"> <option value="">...</option> <option value="chiv">Животные</option> <option value="ptic">Птицы</option> <option value="rast">Растения</option> </select> <select id="categories"> <option value="">...</option> <option value="img\зебра.jpg" class="chiv">Зебра</option> <option value="img\лев.jpg"class="chiv">Лев</option> <option value="img\аист.jpg" class="ptic">Аист</option> <option value="img\дуб.jpg" class="rast">Дуб</option> </select>
And here is the JS code
<script> var day=new Date(); var pictures = ['Sunday.png', 'Monday.png', 'Tuesday.png', 'Wednesday.png', 'Thursday.png', 'Friday.png', 'Saturday.png']; document.write('<img src="' + pictures[day.getDay()] +'">'); }; </script>