I'm dealing with a feed that I have no control over. I need to separate the title into two sections, for example:-
<h3>New Clause 12 - Monitoring tool | Order | Committees</h3>
Needs to land as
<h3>New Clause 12 - Monitoring tool</h3><div> Order | Committees </div>
To that end I want to replace the first half pipe with a </h3><div>
jQuery('h3').html(jQuery('h3').html().replace('|', "</h3><div>"));
This works in JS fiddle, but in practice results in jQuery(...).html() is undefined, for the life of me I cannot see why!
Edit: This, annoyingly, now that its running in the proper place, seems to replace all the titles on the page with the content of the first title.