Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:10:31+00:00 2026-05-26T15:10:31+00:00

In the jQuery below, I tried to add load to the bind arrary in

  • 0

In the jQuery below, I tried to add “load” to the bind arrary in order to get the script to fire on load to evaluate the character count of the text area and set the “over” class when applicable. However, it does not work. What should I add to the bind for this event?

<script type="text/javascript">
    maxCharacters = 160;
    jQuery(document).ready(function()
    {
        var characters = jQuery("#excerpt").val().length;
        jQuery(".c5_counter").text(characters);
        jQuery("#excerpt").bind("keyup keydown load", function()
        {
            var count = jQuery(".c5_counter");
            var characters = jQuery(this).val().length;
            if(characters > maxCharacters)
            {
                count.addClass("over");
            }
            else
            {
                count.removeClass("over");
            }
            //count.text(maxCharacters - characters);
            count.text(characters);
        });
    });
</script>';
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:10:32+00:00Added an answer on May 26, 2026 at 3:10 pm

    Why do you wan’t to trigger it on load? Why not just run the function when the document is ready loading? Which is basically what you are aiming for if I understand your question.

    You can do so like this:

    maxCharacters = 160;
    jQuery(document).ready(function()
    {
        var checkForOver = function()
        {
            var count = jQuery(".c5_counter");
            var characters = jQuery("#excerpt").val().length;
            if(characters > maxCharacters)
            {
                count.addClass("over");
            }
            else
            {
                count.removeClass("over");
            }
            //count.text(maxCharacters - characters);
            count.text(characters);
        };
    
        jQuery("#excerpt").bind("keyup keydown", checkForOver);
    
        // When we are done binding it, trigger the function
        checkForOver();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want fadeIn and fadeout backgroud-color using jQuery, I tried below code, It's affect
I have small jquery script which allows me to load external html content by
below is part of html code <div id=test1><span><input type='text' name='add'/><input type='text' name='del'/><span></div> <div id=container></div>
I m new with jquery.Below is my html table which is in content page.In
I have the jQuery below http://jsfiddle.net/XMdYw/7/ var elements = ''; var ELEMENT_COUNT_PER_PAGE = 301;
Please see the jQuery below: I am really wondering how can I use CSS
i am adding collection of radio buttons to my page using jQuery below $(document).ready(function()
I have some jQuery/JS below. The first thing to run is the alert box
In the Jquery example below, I would like to expand $(this) before it is
I am using the below jquery code to call a ajax function in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.