Answers for "button trigger click"

0

trigger button click jquery

$("input").trigger("click");
Posted by: Guest on August-29-2020
0

force click btn using jquery

example:

<button id='testButton'>Test</button>

<script>
$(function(){
   $('#testButton').on('click' , function(){
        alert("I've been clicked!");
   });

   //now on another event, in this case window resize, you could trigger
   //the behaviour of clicking the testButton?

  $( window ).resize(function() {
        $('#testButton').trigger( "click" );
  });

});

</script>
Posted by: Guest on January-30-2021

Code answers related to "button trigger click"

Code answers related to "Javascript"

Browse Popular Code Answers by Language