Bootstrap Tutorial - Create popover on text input hover








The following code shows how to create popover on text input hover.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){<!--from   ww w . j a va 2  s  .  c  o m-->
    $('#mytext').popover();
});
</script>
</head>
<body style='margin:30px'>
  <div id="container">
    <label for="mytext">My Text:</label> 
    <input id="mytext" type="text"
      data-toggle="popover" data-trigger="hover"
      data-content="My popover content.">
  </div>
</body>
</html>

Click to view the demo