div on click code example
Example 1: click on div with class javascript
<!--In html:-->
<div class="myDiv with_this_class" > any text </div>
<script>
var divClicked = document.querySelector('.myDiv.with_this_class').click();
</script>
Example 2: set onclick jquery
$(elem).click(myFunc());