 <p>Change this line:</p> <pre><code> this.css("text-shadow", sh); </code></pre> <p>to</p> <pre><code> $(this).css("text-shadow", sh); </code></pre> <p>.css is a jQuery function and it works on a proper selector</p> <p><strong>Demo</strong>: <a href="https://jsfiddle.net/wwqxdjvp/" rel="nofollow">https://jsfiddle.net/wwqxdjvp/</a></p>