I did some searching around and found some issues similar to mine, but I was hoping for a resolution that corrects my pre-existing code.
Here's the codepen if you want to see the whole thing: http://codepen.io/JTBennett/pen/ygyZwE
$('#ST_txt_write').keyup(function(){
var childText = $('#ST_cmp_body').text();
var count = (childText.match(/hi/g) || []).length;
$('#ST_KW').html(count);
});
The issue is that I can't get the matching function to work with a textarea so the user can type whatever they want in the box and that will be what the code seeks to match. I tried making a variable that returns the text content of the box (just like the childText var you see there) but that would only match once and be done instead of counting.
Any help in the right direction would be most appreciated. I'm sorry I'm not very good with jQuery, or anything for that matter.