Bootstrap Tutorial - Setup popover content and html escape








The following code shows how to setup popover content and html escape.

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://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<style type='text/css'>
body {<!--from  w  ww .  ja v  a2s.  co m-->
  padding: 40px;
}
</style>
<script type='text/javascript'>
$(function() {
    $('#no-live').popover();
    $(document).popover({
        selector: '[data-toggle="popover"]',
        html:true
    });
});
</script>
</head>
<body>
  <span id="no-live" data-title="title"
    data-content="&lt;b&gt;this should be bold&lt;/b&gt;... and it is!"
    data-html="true">text</span>
  <br>
</body>
</html>

Click to view the demo