crbug.com/292514
by int32_t
HTML
<body>
<section>
<article>
<header>
<h2>Test for onchange in Select element</h2>
</header>
<p>
<select id="sel" size="4">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<input id="checkbox" type="checkbox"> is selected</input>
<p> <button id="deselect">deselect</button> </p>
<button onclick="document.getElementById('sel').selectedIndex=0">Select0</button>
</p>
</article>
</section>
<script type="text/javascript">
// Elements
var select = document.getElementById('sel');
var button = document.getElementById('deselect');
var checkbox = document.getElementById('checkbox');
/**
* Set checkbox according to selection in select element
*/
function changeSelect() {
checkbox.checked = (select.selectedIndex >= 0);
}
/**
* Set listener for change state.
*/
select.onchange = function() {
changeSelect();
};
/**
* Remove selection when button clicked.
*/
button.addEventListener('click', function() {
select.selectedIndex...