jQuery Textarea With Word Count

how to create textarea word count like twitter ?

We can do it very easily by just jQuery ,Let’s start.

first create the html textarea box.

and the jquery part here .

var text_max = 5000
$(‘#count_message’).html(text_max + ‘ remaining’);
$(‘#yt_desc’).keyup(function () {
var text_length = $(‘#yt_desc’).val().length;
var text_remaining = text_max – text_length;
$(‘#count_message’).html(text_remaining + ‘ remaining’);
});

all done !

Advertisements

Published by: amitkumar2226

I'm an easy going person that works well with everyone.I enjoy being around different types of people and i like to always challenge myself to improve at everything i do. Professionally ,I’m a web developer. I spend my whole day, practically every day, experimenting with Php, CSS, and jQuery; and inhaling a wide variety of potentially useless information through a few hundred RSS feeds. I build websites that delight and inform. I do it well. I’m curious, and I enjoy work that challenges me to learn something new and stretch in a different direction. I do my best to stay on top of changes in the state of the art so that I can meet challenges with tools well suited to the job at hand. In my spare time I like to singing , writing song , watching movies.

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s