我正在设置一个重置按钮,通过该按钮将重置现有过滤器。 重置按钮可以正常工作,但出现控制台错误:
未捕获的错误:语法错误,无法识别的表达式:。
在我的js代码的这一行:
jQuery:
$(document).on('click','#reset_team_time_sheet', function(){
//error in these two lines, If I remove these lines the error is not coming
$('.deselect_filter_values').val('').change();
$('#group_by_team_time_sheet').val('day').change();
$('.time-sheet-filter').removeClass('active');
});
HTML代码:
//this is my reset button
<a id="reset_team_time_sheet" class="reset reset-time-sheet" href="javascript:void(0)" onclick="loadTimeSheetData('2019-04-25', '2019-04-25', '', 'team')" data-toggle="tooltip" data-placement="top" data-original-title="Reset">Reset</a>
//Filter
<select name="selected_user" id="user_id_filter_team_time_sheet" class="form-control select2 deselect_filter_values " select2width="140px" select2placeholder="Filter User" data-select2-id="user_id_filter_team_time_sheet" tabindex="-1" aria-hidden="true">
<option data-type="" value="" data-select2-id="6">Filter User</option>
<option data-type="students" value="326" data-select2-id="18">Adam Adcc</option>
<option data-type="students" value="328" data-select2-id="19">Admon Connolly</option>
<option data-type="students" value="479" data-select2-id="20">Alex Ladd</option>
<option data-type="students" value="296" data-select2-id="21">Alexandra Bose</option>
<option data-type="students" value="494" data-select2-id="22">Alysha Zimmermann</option>
<option data-type="students" value="17733" data-select2-id="23">Ashlea McKenzie</option>
请帮助解决此控制台错误。