Bootstrap snippet and html example. Textarea with character count

Bootstrap 3.1.1 snippet "Textarea with character count" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: count,validation,form

HTML code

Clean, semantic HTML that powers this Bootstrap 3.1.1 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<div class="container">
<div class="col-md-7">
<div class="well">
    <form accept-charset="UTF-8" action="" method="POST">
        <textarea class="form-control" id="text" name="text" placeholder="Type in your message" rows="5"></textarea>
        <h6 class="pull-right" id="count_message"></h6>
        <button class="btn btn-info" type="submit">Post New Message</button>
    </form>
</div>
</div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 3.1.1 to keep the design, spacing, and responsiveness consistent.

body{
background:#eee;
}
#text {
    resize: none;
    margin-botton:10px;
}

Javascript/Jquery code

Lightweight JS to power any interactions this snippet needs. Drop it under your scripts (after Bootstrap 3.1.1) to mirror the live demo.

var text_max = 200;
$('#count_message').html(text_max + ' remaining');
  $('#text').keyup(function() {
  var text_length = $('#text').val().length;
  var text_remaining = text_max - text_length;
  $('#count_message').html(text_remaining + ' remaining');
}); 

Similar snippets

Bootstrap example and template. Get in Touch form

Get in Touch form

Bootstrap example and template. blue sign up

blue sign up

Bootstrap example and template. bs4 beta login

bs4 beta login

Bootstrap example and template. password recovery form

password recovery form

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. portfolio with category filter using isotope js

portfolio with category filter using isotope js

Bootstrap example and template. time table

time table

Bootstrap example and template. Faqs frequently asked questions with tabs

Faqs frequently asked questions with tabs

FAQ

How do I use this snippet?

Include Bootstrap 3.1.1, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 3.1.1.

Bootstrap example and template. Textarea with character count

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 11.8K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 3.1.1

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js'></script>

This code example is based on bootstrap 3.1.1 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working