ユーザー入力に基づいて文字列を計算し、メッセージを表示しようとしています:
$('#myInput').keyup(function() {
if(this.value.length<=158)
$('#charCount').text('We will deduct 1 credit from your account');
else if(this.value.length>158 || this.value.length<316)
$('#charCount').text('We will deduct 2 credit from your account');
else if(this.value.length>316 || this.value.length<400)
$('#charCount').text('We will deduct 3 credit from your account');
});
問題は、最後else if
が機能していないことです... 何か見逃したことがありますか?