背景:
项目要求根据value 值选取 value="01 产品销售总览"的 option
<option value="01 产品销售总览" selected="selected">01 产品销售总览</option>
var _selector = "01 产品销售总览";
_selector = _selector.replace(/ /g, "\ ");
var $option = $('select').find('[value='+ _selector +']');
背景:
项目要求根据value 值选取 value="01 产品销售总览"的 option
<option value="01 产品销售总览" selected="selected">01 产品销售总览</option>
var _selector = "01 产品销售总览";
_selector = _selector.replace(/ /g, "\ ");
var $option = $('select').find('[value='+ _selector +']');