M
M
Mirum72020-04-21 15:17:22
JavaScript
Mirum7, 2020-04-21 15:17:22

Why is onchange not working on select tag in js?

onchange does not work on the tag, although the same select in the adjacent element works fine

//не работает
select_border = document.getElementById( 'border-all-select' )
select_border.onchange = function(){opptionTogle()};
//работает
element_width_type = document.getElementById('slect-type-size-width')
element_width_type.onchange = function(){change()}


<select name="border-all-select" id="border-all-select"><option value="all">Все</option><option value="one">Каждый</option></select>

<select name="slect-type-size" id="slect-type-size-width">
                                <option value="px" selected>px</option>
                                <option value="mm">mm</option>
                                <option value="cm">cm</option>
                                <option value="pt">pt</option>
                                <option value="vw">vw</option>
                                <option value="vh">vh</option>
                                <option value="vmin">vmin</option>
                                <option value="vmax">vmax</option>
                            </select>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question