Why doesn't Firefox show the correct default select option?

前端 未结 11 1166
醉酒成梦
醉酒成梦 2020-11-28 07:02

I\'m making a web app to manage product SKUS. One part of that is to associate SKUs with product names. On each row of a table, I list a SKU and display a

11条回答
  •  天涯浪人
    2020-11-28 07:50

    An easy way to prevent Firefox from caching the last selected option is to remove all of the option elements on page unload. For example (assuming jQuery):

    $(window).unload(function() {
      $('select option').remove();
    });
    

提交回复
热议问题