"Dynamic generate whatsapp share button for bootstrap"
Bootstrap 4.1.1 Snippet by kumarmunnait

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Dynamic generate whatsapp share button for blogger</h2> </div> <div class="copied"> <blockquote class="tr_bq"> Don't compare yourself with others. There's no Comparison between The Sun & The Moon. They shine when it's their Time. visit for Demo Link <a title="love shayari" alt="love shayari" href="https://www.thesheroshayari.com/">love shayari</a> </blockquote> </div> For live demo visit : <a title="hindi shayari" alt="hindi shayari" href="https://www.thesheroshayari.com/p/best-latest-hindi-shero-shayari.html">hindi shayari</a> </div>
.copied{ position: fixed; /* or absolute */ top: 50%; left: 50%; } .copied { position: fixed; top: 50%; left: 50%; margin-top: -50px; margin-left: -100px; } blockquote { font-style: italic; color: #888; border: 1px solid #27ae60; border-radius: 3px; background: rgba(1, 255, 36, 0.058823529411764705); width:50%; margin-left: 0; padding: 10px 15px; } blockquote { text-transform: capitalize; margin: 0 auto; } blockquote { font-style: italic; padding: 10px; margin: 0; margin-left: 0px; border-left: 4px solid #e06666; }
/** * visit for my blog shero shayari https://www.thesheroshayari.com/ */ $(document).ready(function(){ $(".copied").append('<div class="sharelevel"><a class="whatsappsend" href="javascript:void(0);">Share on Whatsapp</a></div>'); $(document).on('click','.whatsappsend', function(e){ e.preventDefault(); var whatsapptext = $(this).parents('.copied').find('.tr_bq').text(); var whatsapp_text=encodeURIComponent(whatsapptext); var whatsapp_url = "whatsapp://send?text=" + whatsapp_text; window.location.href = whatsapp_url; console.log(whatsapptext); }); });

Related: See More


Questions / Comments: