當用戶輸入輸入時,我的textarea可以計算字符串/字符。這裏是我的jsfiddle用條件計數字符串使用jquery
我的問題是,我想在字符串/字符是158以上設定條件的意思是,我想展示裏面<div id="message">We will deduct 2 credit from your account</div>
和相同的消息時字符串/字符是316上述消息將更新並顯示< div id="message">We will deduct 3 credit from your account</div>
和繼續。 。
實施例:
158 *2
158 = We will deduct 2 credit from your account
316 = We will deduct 3 credit from your account
474 = We will deduct 4 credit from your account
632 = We will deduct 5 credit from your account
...
感謝,工作就像一個魅力:d – rusly
但爲什麼當我刪除字符串/字符信息不更新? – rusly
我已經更新了您的jsfiddle => http://jsfiddle.net/nrkXG/9/ – ke20