Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

FO-9 Facebook vs Twitter

Create a textarea so the user can type some things about the social media he uses everyday. 

Try to capture how many times the user has written the word 'facebook' and how many times the word 'twitter'. Create two counter variables for both and next to the textarea have 2 span elements, one for each saying:

FB: 5 Shares (assuming that the word 'facebook' was found 5 times in the text)

TW: 4 Tweets (assuming that the word 'twitter' was found 4 times in the text).

Ignore case sensitivity.

Bonus: Make this work even if the user types at some 'fb' (facebook counter gets one more in this case) or 'tw' (twitter counter increases).

At the end your result should look something like this: