Sample code:
<div id="first">first div</div>
<div id="second">second div, click here or on the previous it's the same</div>
Suppose I set an event onclick on the first div that alerts the div’s content.
How do I call that event? In example clicking on the second div I’d like it to call the click event of the first div and alert(‘first div’)
Check out their Element.fireEvent() method. Try this: