1 //Javascript 2 window.οnlοad=function () 3 { 4 var oBtn=document.getElementById('btn1'); 5 6 oBtn.οnclick=function () 7 { 8 alert('a'); 9 }; 10 }; 11 //jquery 12 $(function (){ 13 $('#btn1').click(function (){ 14 alert('a'); 15 }); 16 });
1 //Javascript 2 window.οnlοad=function () 3 { 4 var oBtn=document.getElementById('btn1'); 5 6 oBtn.οnclick=function () 7 { 8 alert('a'); 9 }; 10 }; 11 //jquery 12 $(function (){ 13 $('#btn1').click(function (){ 14 alert('a'); 15 }); 16 });
转载于:https://www.cnblogs.com/yanyiyaner/p/9179268.html