js dom get clicked elements code example
Example 1: javascript button onclick programmatically
document.getElementById("myCheck").click();
Example 2: how to get the text of a clicked elemet by javascript
document.addEventListener('click', function(e) {
e = e || window.event;
var target = e.target || e.srcElement,
text = target.textContent || target.innerText;
}, false);