0
我不能得到這個工作,有什麼不對?模糊/焦點腳本有什麼問題?
我想設置值,在模糊和專注於我與類「ginput_quantity」輸入
<html>
<head>
<script src="jquery-1.10.2.min.js"></script>
<script>
$('.ginput_quantity').val(0);
$(document).on('blur','.ginput_quantity',function(){
if (this.value == '') {this.value = '0';}
})
$(document).on('focus','.ginput_quantity',function(){
if (this.value == '0') {this.value = '';}
})
</script>
</head>
<body>
<input type="text" value="" class="ginput_quantity">
<input type="text" value="" class="ginput_quantity">
<input type="text" value="" class="ginput_quantity">
<input type="text" value="" class="ginput_quantity">
<input type="text" value="" class="ginput_quantity">
</body>
</html>
我知道佔位符 - 很聰明,但不是在我的情況。 – pstidsen