Citing appears to be malfunctioning when attempting to implement it on a button

Hello there,
I am using OJS version

I’m encountering issues while integrating the code snippet from the “How to cite” segment in the article_details.tpl into a new button created in indexJournal.tpl. The objective is for the button to display the “How to Cite” segment when clicked. Unfortunately, it’s not functioning as expected. I’ve attached screenshots for better reference. Any insights on why this might be happening would be greatly appreciated. Thank you.