이벤트 시뮬레이션

1665 단어


    
        
        
        <script src="js/jquery-3.1.0.js" type="text/javascript" charset="utf-8"/>
        <script type="text/javascript">
</code></pre> 
 <pre><code>        $(document).ready(function(){
</code></pre> 
 <h4>// </h4> 
 <pre><code>            $('div').click(function(){
                alert('12321321321312');
            }).click();
</code></pre> 
 <h4> : , </h4> 
 <h4>// trigger ()  triggerHandler()  ,</h4> 
 <h4>// trigger()  </h4> 
 <h4>// triggerHandler()  </h4> 
 <h4>//   a submit  </h4> 
 <pre><code>            //$('div').trigger('click');
            //$('div').triggerHandler('click');
            
            
            //$('form').trigger('submit');
            //$('form').triggerHandler('submit');
            
            
            /*$('a').click(function(){
                alert('3221321');
            });
            
            $('a').triggerHandler('click');*/
        });
    </script>


    <div> </div>
    
    <form action="http://www.baidu.com" method="get">
        <input type="submit" name="" id="" value=" , "/>
    </form>
    

</code></pre> 
  
</article>
                            </div>
                        </div>

좋은 웹페이지 즐겨찾기