Trigger Another Event : trigger « jQuery « JavaScript DHTML






Trigger Another Event

    

<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
               $("h1").click(function () {
                  alert("h1");
               });
               $("button:last").click(function () {
                    $("h1").trigger('click');
                    
               });



        });
    </script>


  </head>
  <body>
    <body>
       <div><h1>header 1</h1></div>
       <button value="asdf">asdf</button>
    </body>
</html>

   
    
    
    
  








Related examples in the same category

1.Triggered By Select Change Event
2.Trigger handler
3.Triggers the blur event of each matched element
4.Trigger Submit Event
5.Trigger a custom event
6.trigger(type , data )
7.To submit the first form without using the submit() function
8.Display a "Hello World!" alert box.