//監聽input值的改變
$('.target1').change(function(e) {
$("#result").html(e.target.value)
});
//e.target.value是剛才輸入的值
$('.target1').change(function(e) {
$("#result").html(e.target.value)
});
//e.target.value是剛才輸入的值
2016-07-17
和keydown不一樣,keyPress不是按下按鍵就馬上反應的,是等到下一個按鍵按下才顯示的.即獲取的是之前的輸入。
2016-07-15
重點在 $("button:first").trigger('click','last');直接引用了第一個按鈕的事件,'last'傳給bottonName做參數,所以點擊第二個按鈕,bottonName =“last”,接下來就是update()函數了,update(firstq,lastq,bottonName) 在第一個按鈕點擊事件時first,last,已經傳入參數$("span:first"),$("span:last"),也就是顯示內容的首位名稱和第二位數字,接下來update()函數里面把first.text()根據點擊改括號里面內容,last或first數字同理
2016-07-14