Bootstrap Tutorial - Show popup for focused text input








The following code shows how to show popup for focused text input.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.10.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0-rc1/css/bootstrap.min.css">
<script type='text/javascript'
  src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){<!--from ww  w.  j  a  v a2s  .c o  m-->
    $('input[type=text]').popover({trigger:'focus'});
});
</script>
</head>
<body>
  <table cellpadding="5" width="50%">
    <tr>
      <td>Name</td>
      <td><input type="text" id="name" data-content="name"
        name="name" class="form-control" /></td>
    </tr>
    <tr>
      <td>Password</td>
      <td><input type="text" name="cvr" class="form-control"
        data-content="password" /></td>
    </tr>
  </table>
</body>
</html>

Click to view the demo