title: how to pass parameters to popover content function of bootstrap
body: <p>I want to add conditions as to what type of text should be shown in popovers.
  So I wrote the function:</p>
  <pre><code>var initErrorPopOverEvent = function(hasRequiredError,option){
           if(hasRequiredError !== undefined &amp;&amp; hasRequiredError === true){
               $(&quot;.icon-warning-lg&quot;).popover({
                   html:true,
                   placement:'top',
                  'trigger': 'hover ',
                   content:function(){
                       return $(&quot;#required-field-error&quot;).text();
                   }
               });
           }
           if(option !== undefined){
               if(option === &quot;option1&quot;||option === &quot;option2&quot;){
                   $(&quot;#opt1-warning&quot;).popover({
                       html:true,
                       placement:'top',
                      'trigger': 'hover ',
                       content:function(){
                           return $(&quot;#opt1-error&quot;).text();
                       }
                   });
               }
               if(option === &quot;option3&quot; || option === &quot;option2&quot;){
                   $(&quot;#opt2-warning&quot;).popover({
                       html:true,
                       placement:'top',
                      'trigger': 'hover ',
                       content:function(){
                           return $(&quot;#opt2-error&quot;).text();
                       }
                   });
               }
           }
       }
  </code></pre>
  <p>But I want all these conditions to go inside the function which displays popover content.
  something like:</p>
  <pre><code>content:function(hasRequiredError,option){//render text according to condition
  }
  </code></pre>
  <p>How do I do this?</p>