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
  • 21,823
  • 33
  • 109
  • 156
Pawan
  • 29,827
  • 94
  • 242
  • 415

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.
  • 73,526
  • 17
  • 164
  • 143
0

try this - Use .trigger() function

$(document).ready(function(){
    $("#BrandNames").trigger('change');
});
prog1011
  • 3,315
  • 3
  • 26
  • 54