So I just playing around with the comparison table today. And the save table and be able to share the table url publicly is great. Think is many users don't know that. So I'm writing a button "copy url"
Please see picture

Attachment 4189

Basically clicking on button will copy the table url. Here my code in bold

Code:
Only registered members can view the code.
The url of table are printed above the button correctly.
But for some reasons, the button always copy the url of the newest table, the table on top, even though I click on the second, third table button. How do I fix it so that it will copy the correspondant table url?