sunil sunil - 2 months ago 11
AngularJS Question

dropdown select box option not working in chrome browser

when i select the language english in firefox then alert come but when i

select it in chrome then alert not display.i don't know what is wrong there.

below is the code of select box:

<select name="setlanguage" id="setlanguage" class="language" data-ng-model="setlanguage">

<option onclick="alert();"><span>English</span></option>

<option><span>French</span></option>

</select>

Answer

use onchange on the select tag--

<select name="setlanguage" id="setlanguage" class="language" onchange="alert('worked')" data-ng-model="setlanguage">
     <option>English</option>
     <option>French</option>
</select>
Comments