Edited to clarify requirements
I am trying to simulate a click in a div through browser scripting. The div I am working on is :
<div id="myid" class="myclass" hidefocus="true" aria-label="Message Body" g_editable="true" role="textbox" aria-multiline="true" contenteditable="true" tabindex="1">hello how</div>
The problem is that I am able to trigger a focus but I wanted a drop down to appear that only appears after a click has been made. The focus is occuring but I cannot simulate the click. My requirement is to use Javascript alone. What I have tried:
document.getElementById("id1").dispatchEvent(new Event("click"));