1

This is my jsfidle

http://jsfiddle.net/33uosw6c/1/

I have a combobox as shown

<select id="BrandNames">
<option value="3001">KFC</option>
</select>


$(document).on('change', 'select#BrandNames', function(event) {

    alert('hii');

});

How can I trigger a chnage event manually ??

Ajinkya
  • 22,324
  • 33
  • 110
  • 161
Pawan
  • 31,545
  • 102
  • 256
  • 434

2 Answers2

3

Try this

$('select#BrandNames').trigger('change');

or

var event    = jQuery.Event('change');
event.target = $(document).find('select#BrandNames').get(0);
$(document).trigger(event);

Example

Oleksandr T.
  • 76,493
  • 17
  • 173
  • 144
0

try this - Use .trigger() function

$(document).ready(function(){
    $("#BrandNames").trigger('change');
});
prog1011
  • 3,425
  • 3
  • 30
  • 57