I want to trigger a double click on a button when the dropdown changes. Single click works for me but I want double click.
$('#fruitIds').change(function() {
$("#btn-search").dblclick();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="fruits" id="fruitIds" style="width: 140px;">
<option selected="selected" value="">Days</option>
<option value="5">5 Days</option>
<option value="10">10 Days</option>
<option value="15">15 Days</option>
<option value="20">20 Days</option>
<option value="25">25 Days</option>
</select>
<button type="button" class="btn btn-primary btn1" id="btn-search">Apply Filter</button>
2
Answers
According jQuery:s documentation dblClick is deprecated and should be replaced with trigger.
Does this work for you:
Check Your Jquery version jquery 3.6.4 version perfectly working.
Example