I search and research into the foruns, of all the internet... but I don't found it the solution...
I need, this:
<label> Name:
<input type="text" id="name" name="name" required />
</label>
<div class="container">
<div class="progress progress-danger progress-striped active">
<div class="bar" id="progBar" ></div>
</div>
</div>
So, I want that when the user exits the field (onBlur), he receives the amount of characters and return as the value of the progress bar, and if this parameter is negative, return as the value of the progress bar, only negative, or is the bar again.
The code of bar and JS...
$(document).ready(function() {
$("*").blur(function() {
var $bar = $("#progBar");
var $name = $("name");
if ($("#name").val().length > 2) {
$bar.css('width', "30%");
} else {
$bar.css('width', "-30%"); //How, I do this????????
}