I've taken a look at a lot of the questions but couldnt find relevant code to help me. Most of the questions people have asked want a span after the first word but i need to dynamically input a <br />
AND then wrap the rest of the text in a span after the first word of a nav anchor link. Also this will only affect the first (parent) level of li/anchors.
Here is the html:
<nav id="smoothmenu1" class="ddsmoothmenu">
<ul>
<li><a href="index.html" class="current">Home our main page</a></li>
<li><a href="blog.html">Blog latest events</a>
<ul>
<li><a href="single.html">Single</a></li>
</ul>
</li>
<li><a href="about.html">About company, team</a></li>
<li><a href="services.html">Services we offer services</a></li>
</ul>
</nav>
I want the code to spit out like this:
<nav id="smoothmenu1" class="ddsmoothmenu">
<ul>
<li><a href="index.html" class="current">Home <br /><span>our main page</span></a></li>
<li><a href="blog.html">Blog <br /><span>latest events</span></a>
<ul>
<li><a href="single.html">Single</a></li>
</ul>
</li>
<li><a href="about.html">About <br /><span>company, team</span></a></li>
<li><a href="services.html">Services <br /><span>we offer services</span></a></li>
</ul>
</nav>