Does anybody know whether this can be achieved in jQuery. Target/addClass to the last word of an element, in this case the word ‘Text’ within a h1 tag. Bear in mind I know I can target the last word with a span tag but I’m working with a CMS that has something like %My_heading% markup. (not exactly but I’m hoping this is understood)
<h1>Some Heading Text</h1>
1 Answer