<!--In html:--> <div class="myDiv with_this_class" > any text </div> <script> var divClicked = document.querySelector('.myDiv.with_this_class').click(); </script>