update the font family for special characters using jQuery

update the font family for special characters using jQuery

Hi all, please bear in mind i am a beginner

I am using a font family that does not render special characters characters such as &,£ etc. so im looking for a solution to target all special characters (site wide) and change them to a different (similar) font family.

Can this be achieved using jQuery? For example declare an string array that holds the characters i want to target and write some code to update these?

Using the following jQuery it will target the word package in any h3’s site wide, apply the span class font-fix and update the word to say test

$('h3').each(function () { $(this).html( $(this).html().replace(‘package’, '<span class=\'font-fix\'>test</span>') ); });

However when I attempt to target the £ sign or any other special char it doesn’t seem to work.

$('h3').each(function () { $(this).html( $(this).html().replace(‘£’, '<span class=\'font-fix\'>£</span>') ); });

Can anyone tell me what I’m doing wrong please? – Id like to be able to target all heading tags and paragraph tags replacing the special characters

Many thanks

Paul