Use data-id as a placeholder for a variable.
If $quoteID = 953
then the alert will get 953 alerted….
1 2 3 4 5 6 7 8 9 10 |
<button type="button" id="quotedetails" data-id="<?php echo $quoteID; ?>" class="btn-primary btn-sm btn-info dupe" >Quote Details</button> <script> $(document).on('click', '#quotedetails', function() { var myBookId = $(this).data('id'); alert(myBookId); }); </script> |