jquery處理當input輸入框默認爲0時,聚焦讓其置空;失焦如果爲空時,讓其至0處理;
//這是一個例子 input 輸入框聚焦,失焦,及綁定改變事件;
$("input.totalnum").focus(function() {
var prs=$(this).val();
if(prs==0||prs=='0'){
$(this).val("")
}
}).blur(function() {
var prs=$(this).val();
if(prs==""){
$(this).val(0)
}
}).bind('input propertychange', function() {
/********內容略。。。*****/
});