1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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)

    oo7ml, Mar 11, 2012 IP
  2. blacknet

    blacknet Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    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 Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Cool, thanks for your help...
    oo7ml, Mar 12, 2012 IP