Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div class="well clearfix">
    <textarea class="form-control"></textarea><br>
    <span>140</span>
    <button class="btn btn-primary pull-right">Tweet</button>
  </div>
</body>
</html>
 
$("button").prop("disabled", true);
$("textarea").on("input", function() {
  $("span").text(140 - $(this).val().length);
  
  if ($(this).val().length > 0) {
    $("button").prop("disabled", false);
  } else {
    $("button").prop("disabled", true);
  }
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
chibicodepro
0viewers