Javascript examples for jQuery:Mouse Event
Change click event handler in the code
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> </head> //from w w w. ja v a2 s. com <body> <div class="my"> <a href="#" onclick="show()">me 1</a> <a href="#" onclick="show()">me 2</a> </div> <script type="text/javascript"> $('.my').find('[onclick="show()"]').attr('onclick', 'showme()'); function show() { console.log('show'); } function showme() { console.log('showme'); } </script> </body> </html>