JS Character Countdown (photo)

Discussion in 'JavaScript' started by oo7ml, Mar 11, 2012.

  1. #1
    Hi, i am trying to find a good JS character countdown script that i can use to count down the characters remaining in a text area field that i am using on my site.

    I have done a lot of searching on google but a lot of them seem to have very long scripts and others scripts are over 6 years ago.

    Can someone recommend a good, robust character countdown timer that works very well and does not require a lot of resources when it is running. I was hoping to find something similar to the twitter script (please see below)

    [​IMG]
     
    oo7ml, Mar 11, 2012 IP
  2. blacknet

    blacknet Active Member

    Messages:
    709
    Likes Received:
    16
    Best Answers:
    2
    Trophy Points:
    70
    #2
    something like the following should do it, any queries simply google the function name and read a bit more about it

    document.getElementById('yourtextarea').onchange = function(e) { document.getElementById('showcountdown').textContent = (140 - document.getElementById('yourtextarea').value.length); }
    Code (markup):
     
    blacknet, Mar 12, 2012 IP
  3. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Cool, thanks for your help...
     
    oo7ml, Mar 12, 2012 IP