Adding Social Media Share buttons to a query

I would like to add a Facebook and Twitter share button to some JS code I have but not sure how to go about it?

Ideally I’d like a small share this button that would bring up a custom message that I have created

How do I go about this?


You can start from looking at the javascript snippet that add the buttons on the page. Most of them just create a script element and then add an iframe into the element with specific class or id (target element). So your script should do the same but for all of them. The target elements should be placed into the element with the custom message that you mentioned.

Thanks, are there any walkthroughs or anything around?

I’m still REALLY new to JS so its a learning curve for me