javascript - Mobile browsers freezing on jQuery prompt -


i want users able enter own options few selects when selecting "add new". using following code answer, can't remember where, works:

$(function(){ $('select').change( function(){     var value = $(this).val();     if (value == 'new') {         var other = prompt('add new:');         if(!other) return false;         $(this).append('<option value"'             + other             + '" selected="selected">'             + other             + '</option>');     } }); }); 

however, when try "add option" mobile devices, iphones far, browser displays prompt freezes completely, forcing restart of browser. occurs in chrome not safari. there other ways of prompting text input or doing wrong? not experienced jquery.

i using jquery 1.11.3 google cdn.

jsfiddle gives me same result of working on pc , in mobile safari, not on mobile google chrome. tried iphone 5.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -