I have a generated navigation, The first n items have _ in front of them to always be at the top of list. What I want to accomplish now is to remove that _ from the front-end of the site.
I tried to do this with the jQuery code below which almost worked but it is also changing the text of other nav items.
See full mark-up on JS Fiddle: https://jsfiddle.net/1fz661o4/
Code:
$(function() {
$('.dropdown-submenu').html($('.dropdown-submenu').html().replace(/\_/g,''));
});
_on the nav you want.Software OneandSoftware Twois easy solvable. You are replacing directly with an automatic loop made by jQuery. If you use your own loop and take the current element with$(this)the problem disappears.