I have been trying to add a wrap element to specific words on my website. I found a Jquery solution that seems to work really well.
Solution i followed: http://jsfiddle.net/trtcN/546/
I can get it all to work exactly how i would like it to work. When is start to bring it into my website things fall away..
Ive linked to my custom js file in my child theme using the following: (... replaces the full link)
<script src="...custom.js" type="text/javascript"></script>
and my custom file contains the following code:
var oldString = 'Choose a Start Date',
newString = 'Choose a <span class="date-style-change">Start</span> Date',
newText = $('span').text().replace(RegExp(oldString,"gi"),newString);
$('span').html(newText);
However when i refresh my page nothing has changed and there is a error in developer tools console which reads:
Uncaught TypeError: $ is not a function
Do i need to add some extra code to the js file that isn't on jsfiddle i was following?