Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: number is prime or not in javascript 
Javascript :: react router get data from url 
Javascript :: get date in specific timezone 
Javascript :: store input into array javascript 
Javascript :: stop page refresh on button click react 
Javascript :: how to save and use item from local storage javascript 
Javascript :: javascript if value is a string function 
Javascript :: make text lowercase javascript 
Javascript :: click counter in javascript 
Javascript :: joi unique validation 
Javascript :: preview upload image jquery 
Javascript :: react slick 
Javascript :: js + before variable 
Javascript :: angular pipe percentage 
Javascript :: get top window url from iframe 
Javascript :: express router file 
Javascript :: regex remove duplicates 
Javascript :: jquery change select value 
Javascript :: js array includes 
Javascript :: run function then empty it javascript 
Javascript :: can you call a function within a function javascript 
Javascript :: mongoose pagination with total count 
Javascript :: two array in one js 
Javascript :: react native making bigger hitbox 
Javascript :: how to get all the voice channels in discord js 
Javascript :: how to remove more than one attribute using jquery 
Javascript :: png to base64 javascript 
Javascript :: how to get range slider value in javascript 
Javascript :: how to add number in string in javascript 
Javascript :: log odd numbers js 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =