Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select id="lang_select">
- <option value="en" selected="selected">english</option>
- <option value="ar">العربية</option>
- <option value="az">azərbaycanlı</option>
- <option value="bg">български</option>
- <option value="ca">català</option>
- <option value="cs">český</option>
- <!-- some data cut -->
- </select>
- $(document).on('change',"select",function(){
- var i = $(this)[0].selectedIndex;
- var ch = $(this).children().each(function(index){
- $(this).prop('selected',index == i);
- if (index == i) {
- $(this).attr('selected','selected');
- } else {
- $(this).removeAttr('selected');
- }
- });
- });
Add Comment
Please, Sign In to add comment