jQuery 代码:
$("#input1").bind("input propertychange",function(event){
console.log($("#input1").val());
});
JavaScript 代码:
// Firefox, Google Chrome, Opera, Safari, InternetExplorer 9+
function oninput (event) {
alert ("The new content: " + event.target.value);
}
// InternetExplorer8-
function onpropchanged (event) {
if (event.propertyName.toLowerCase () == "value") {
alert ("The new content: " + event.srcElement.value);
}
}