$(function(){
/**
* a、當前對象屬性改變,並且是由鍵盤或鼠標事件激發的(腳本觸發無效)
* b、當前對象失去焦點(onblur)
*/
$("#change").change(function(){
console.log("change="+$(this).val());
});
/**
* a、keypress/keydown/keyup監聽鍵盤事件,鼠標復制黏貼操作無效
*/
$("#keypress").keypress(function(){
console.log("keypress="+$(this).val());
});
/**
* a、input是標准的瀏覽器事件,一般應用於input元素,當input的value發生變化就會發生,無論是鍵盤輸入還是鼠標黏貼的改變都能及時監聽到變化
* b、propertychange,只要當前對象屬性發生改變。
*/
$(".center").delegate(".center_comment" ,"input propertychange " ,function(){
console.log ($(this).val())
})
});
</script>
</html>
