<h4>測(cè)試二</h4>??? <div class="test2">??????? <p>$('button:first').click(function(e) {alert(this)})</p>??? </div>??? <button>指定觸發(fā)事件</button>??? <script type="text/javascript">??????? $('p').click(function(e) {??????????? alert(e.target.textContent)??????? })??????? //this指向button元素??????? $("button:eq(1)").click(function() {??????????? $('p').click() //指定觸發(fā)綁定的事件??????? })??? </script>//為什么彈出[object HTMLButtonElement]<h4>測(cè)試三</h4>??? <div class="test3">??????? <p>$('.right').mousedown(1111, set)</p>??? </div>??? <button>不同函數(shù)傳遞數(shù)據(jù)</button>??? <script type="text/javascript">??? //不同函數(shù)傳遞數(shù)據(jù)??? function data(e) {??????? alert(e.data) //1111??? }??? function a() {??????? $("button:eq(2)").mousedown(1111, data)??? }??? a();??? </script>//求解,為什么返回1111呢?data又是做什么用的?
下面粗體求解
昵稱(chēng)什么DE
2017-07-14 10:16:09