How to set jQuery UI toggle programmatically?
- by bebraw
I noticed it is possible to set the value of a jQuery UI slider in the following way:
$("#mySlider").slider("value", 42);
This triggers the event handlers attached to the slider as expected.
Now I'm trying to do the same trick using a button (toggle). There does not appear to be a nice way to do this in the API. I might just be missing something simple.
I tried the following with no results:
$("#myButton").button().click();
Any ideas how to handle that in this case are welcome. Note that it would be awesome to find a solution that applies for a buttonset as well.