When selecting one of the options in select, the input should change the style. Initially, the input is hidden (display: none) After clicking on the option, the style changes to display: inline The following code does not work in chrome and Yandex browsers, everything is normal in the browser and IE, what could be the reason?
html
<select class="form-control"> <option onclick="click2();" value="variable1">Первая</option> <option onclick="click2();" value="variable2">Вторая</option> <option onclick="click2();" value="variable3">Третья</option> <option onclick="click2();" value="variable4">Четвёртая</option> <option onclick="click1();" value="variable5">Добавить свою</option> </select><br> js
<script type="text/javascript"> function click1 () { document.getElementById('test').style.display = 'inline'; } function click2 () { document.getElementById('test').style.display = 'none'; } </script>