Bootstrap Tutorial - Add focus class to form control








The following code shows how to add focus class to form control.

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<style type='text/css'>
.form-control:focus {<!--  ww  w.  j av a  2  s.  co m-->
  border-color: #1ABC9C;
  box-shadow: none;
}
</style>
</head>
<body>
  <form class="form-inline" role="form">
    <div class="input-group">
      <input class="form-control" type="text"> <span
        class="input-group-btn">
        <button class="btn btn-default" type="button">Search</button>
      </span>
    </div>
  </form>
  <script
    src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
</body>
</html>

Click to view the demo