Sublime Text
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> </head> <body> <button type="button" id="button1">Click ĐƠN chuột trái</button> <hr> <button type="button" id="button2">Click KÉP chuột trái</button> <script> $(document).ready(function(){ $("#button1").click(function(){ $("#button2").dblclick(); }) $("#button2").dblclick(function(){ alert("Sự kiện dblclick() vừa mới xảy ra!"); }) }) </script> </body> </html>
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> </head> <body> <button type="button" id="button1">Click ĐƠN chuột trái</button> <hr> <button type="button" id="button2">Click KÉP chuột trái</button> <script> $(document).ready(function(){ $("#button1").click(function(){ $("#button2").dblclick(); }) $("#button2").dblclick(function(){ alert("Sự kiện dblclick() vừa mới xảy ra!"); }) }) </script> </body> </html>