The Goal:
Sometimes you want to alter the text, background, or animation of a particular element based on whether the words in match. For example, if a div has the word “home” change the word home to an icon instead.
Requirements:
- HTML
- jQuery
- Font Awesome (a registered account)
CodePen
This example shows the required files, HTML and jQuery markup.
See the Pen
If element CONTAINS a word Do Something | jQuery by Brittany Golden (@brittany-golden)
on CodePen.