<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<div id="div1">Click here</div>
</div>
</form>
<script type="text/javascript">
var $ = function(e) { return document.getElementById(e); };
var pageDefault = {
btn1: $('Button1'),
testfx: function() {
alert('test');
},
init: function() {
this.btn1.onclick = function() {
this.testfx();
return false;
}
}
}
pageDefault.init();
</script>
</body>
为什么button1点击事件不会触发?