title: Adding a onclick to the facebook like button
body: <p>So what I'm trying to do is create an onclick listener to the Facebook like button on my page. Once button is liked, I just want to be able to hide the element contained that the Facebook like is in. However being new to JavaScript, I'm not sure how to adjust the JavaScript Facebook provides to do this. </p>
  
  <p>The code I have is as follow: </p>
  
  <pre><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
                      &lt;script&gt;(function(d, s, id) {
                        var js, fjs = d.getElementsByTagName(s)[0];
                        if (d.getElementById(id)) return;
                        js = d.createElement(s); js.id = id;
                        js.src = "http://connect.facebook.net/en_GB/sdk.js#xfbml=1&amp;version=v2.5&amp;appId=~~";
                        fjs.parentNode.insertBefore(js, fjs);
                      }(document, 'script', 'facebook-jssdk'));
  
                      FB.Event.subscribe('edge.create', function(response) {
                      console.log('button clicked');
                      });&lt;/script&gt;
  
                      &lt;div class="fb-page" data-href="https://www.facebook.com/~~" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"&gt;&lt;div class="fb-xfbml-parse-ignore"&gt;
                      &lt;blockquote cite="https://www.facebook.com/~~"&gt;&lt;a href="https://www.facebook.com/~~"&gt;~~&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I've read up somewhere that it's best to use:</p>
  
  <pre><code>FB.Event.subscribe('edge.create', function(response) {
                      console.log('button clicked');
                      });
  </code></pre>
  
  <p>To do this. How would I implement this to work?
  Any help of guidance would be much appreciated.
  Thanks.</p>