How to Attach Code to a Facebook Share Button
The Facebook Share button is a button that can be embedded into websites to give visitors a quick way to share the site's content. The button itself is added to a particular webpage using a few lines of code. If you want to alter the Share button in any way by adding code to the script, you can learn how to do so by following a few steps.
Instructions
-
-
1
Open your Web page's HTML file in the Windows Notepad application that is bundled with Windows operating systems.
-
2
Scroll through the HTML file and locate the beginning of the Facebook Share button script. The code begins with a line that looks like this:
<script>function fbs_click()
-
-
3
Add your own code anywhere between the </script> tag and the end of the Facebook Share button's code block. You can't make any changes to the script itself (which is located between the <script> and </script> tags), but you can make changes to the physical appearance of the Facebook Share button by following these steps.
-
1