Answers for "click element by class javascript"

62

javascript element by class

var elementsArray = document.getElementsByClassName("someclassname");
Posted by: Guest on June-17-2019
0

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>
Posted by: Guest on November-24-2020

Code answers related to "click element by class javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language