javascript - how to reveal coupon code using php -
i want reveal coupon code on button click
<script type='text/javascript' > jquery('#id1').click(function(){ jquery(this).replacewith("<?php echo $_coupon?>"); }) </script> <?php if ($_coupon != '' ):?> <button id="id1" type="button" class="but" value="button name"> </button> <?php endif; ?>
this code works first button click means show 1 value not works loop please me solve problem
i way:
<script type='text/javascript' > jquery('#id1').click(function(){ jquery(this).replacewith(jquery(this).val()); }) </script> <?php if ($_coupon != '' ):?> <button id="id1" type="button" class="but" value="<?php echo $_coupon ?>"></button> <?php endif; ?>
Comments
Post a Comment