The createEvent() method allows you to simulate events.
"myDiv" will get a new star every time you mouse over it:
Simulate Mouse Over