jquery - Bootstrap popover title option do not override the html element title -


i'm initializing bootstrap's popovers this:

$(document).on("click", ".print-barcode", function () {      $(this).popover({          html: true,          container: 'body',          title: '<strong>some other title</strong>',          content:          '<div class="form-group per60">' +            '<div class="input-group">' +              '<input class="form-control print-quantity" type="text" placeholder="бр" value="1" >' +              '<div class="input-group-btn">' +                '<button class="btn btn-default print-barcode-send"  >' +                	'<span class="glyphicon glyphicon-print"></span>' +                '</button>' +              '</div>' +            '</div>' +          '</div>',          placement: 'bottom'      }).popover('toggle');  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"> </script>    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />    <div class="container">    <button class='btn btn-sm btn-default print-barcode' data-toggle='tooltip' data-placement='top' title='print barcodes' value='4575456465' data-product-name='product name' data-product-price='123'><span class='glyphicon glyphicon-barcode'></span></button>  </div>

the problem title set in jquery not override button title attribute.

any ideas?

i had exact same problem, jyothi's solution wasn't working me.

i discovered tooltips work off of data-title title, popovers don't override config titles data-title values.

$(".print-barcode").tooltip({trigger: "hover"}); //don't have usually, make work on reason.  $(document).on("click", ".print-barcode", function () {      $(this).popover({          html: true,          container: 'body',          title: '<strong>some other title</strong>',          content:          '<div class="form-group per60">' +            '<div class="input-group">' +              '<input class="form-control print-quantity" type="text" placeholder="бр" value="1" >' +              '<div class="input-group-btn">' +                '<button class="btn btn-default print-barcode-send"  >' +                	'<span class="glyphicon glyphicon-print"></span>' +                '</button>' +              '</div>' +            '</div>' +          '</div>',          placement: 'bottom'      }).popover('toggle');  });
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>    <div class="container">    <button class='btn btn-sm btn-default print-barcode' data-title="print barcodes" data-toggle='tooltip' data-placement='bottom' data-trigger="hover" value='4575456465' data-product-name='product name' data-product-price='123'><span class='glyphicon glyphicon-barcode'></span></button>  </div>


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -