I would like to know how can I fire an event from code. In jQuery to fire a "onchange" event you would simply $("selector").trigger("change"). Is there a way to do the same using WinJS.
[All suggestions of including jQuery will be discarded]
Thanks.
fireEvent
is probably what you want.
Fires a specified event on the object.
Given that markup
<p>
<button
id="oButton"
onclick="this.innerText='I have been clicked!'">Button
</button>
</p>
You can do
oButton.fireEvent("onclick");