A Pen by zhishaofei on CodePen.
Created
May 18, 2017 06:18
-
-
Save zhishaofei3/dd674ab28ea49e385cc018d61d9b1531 to your computer and use it in GitHub Desktop.
pPOOwa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="btn1">1</button> | |
<button class="btn2">2</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.btn1').click(function () { | |
console.log('btn1'); | |
}); | |
$('.btn2').click(function () { | |
console.log('btn2'); | |
$('.btn1').trigger('click'); | |
$('.btn1').click();//与上一行等价 | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment