Date: 2010jul7
Platform: jQuery
Language: javaScript
Q. How simulate a user changing their choice for a <select> in jQuery?
A. This is only useful if you have a function to that reacts.
// make your function mySelectChanged() execute when the user
// changes the <select>
$('.myselect').change(mySelectChanged);
// Later in the code, whenever you want it do this
// to simulate the user making the change. Your function will execute.
$('.myselect').trigger('change');
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment