You never remove the selected attribute in the option tag. So after using the script, your HTML code looks like this:
<select id="tehlike_sinifi"> <option value="1" selected="selected">"Az Tehlikeli"</option> <option value="2" selected="selected">"Tehlikeli"</option> <option value="3" selected="selected">"Çok Tehlikeli"</option> </select>
Firefox does not know which option to choose.
Try using the val() function instead of setting the selected attribute.
From jQuery documentation
[jQuery.val] checks or selects all radio buttons, checkboxes, and selects options that match a set of values.
The val() function works fine.
if ($.inArray($("#nace_kod").val(), aztehlikeliNace) >= 0) { $("#tehlike_sinifi").val(1); } if ($.inArray($("#nace_kod").val(), tehlikeliNace) >= 0) { $("#tehlike_sinifi").val(2); } if ($.inArray($("#nace_kod").val(), coktehlikeliNace) >= 0) { $("#tehlike_sinifi").val(3); }
Demo
R3tep source share