I'm working with feed that I have no control over. I need to replace the first half pipe character in each of a number of headlines with a <div> e.g.
<h3>New Clause 12 - Monitoring tool | Order | Committees</h3>
Changes to
<h3>New Clause 12 - Monitoring tool</h3><div> Order | Committees </div>
This script works, but it's replacing all instances of | and replacing the entire contents of every h3 on the page with the content of the first headline. How can I limit the scope of the script to affect only the first | and leave the headlines text content unaltered?
jQuery('h3').html(jQuery('h3').html().replace('|', "</h3><div>"));
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<h3>New Clause 12 - Monitoring tool | Order | Committees</h3>