Increase visible text on click.

Increase visible text on click.

I am trying to increase the words that are visible when user clicks on the link. It does not seem to listen to the  click command. How can I achieve this? My code looks like below. 

  1. $(document).ready(function () {

  2. var $wordCount = 12;


  3. $("h2").on("click", function () {
  4. var $wordCount = 112;
  5. });


  6. function getWords(str) {
  7.     return str.split(/\s+/).slice(0, $wordCount).join(" ");
  8. }

  9. var str = $(".hider").text();
  10. $(".showHere").text(getWords(str));
  11. });

See work on fiddle