Shortcode button dosent work for all posts. Work for first post only


I am creating a custom wordpress theme and i am little stuck in one situation, Actually i added a download link button and add some javascipt on it. The button on all posts showing and downloading fine, but according to the javascript,the (shortcode button/downlaod link button) is only clicked 2 times, after 2 times it atomatically disappers…..
The javascript code is working fine only for very first post. for other posts it does not work.

here below is my code:-

<script src=""></script>
                  var i = 0
                            if(i == 2)
                             document.getElementsByClassName('gotocls')[0].style.display = 'none';
            ``  });

          <a class="dkpdf-button gotocls" href=""  target="_blank"><span class="dkpdf-button-icon"><i class="fa fa-file-pdf-o"></i></span> <?php echo $pdfbutton_text;?></a>
, , , , Almight Hacker 2 years 2020-09-01T06:10:24-05:00 0 Answers 58 views 0

Leave an answer