Birdhouse Websites and Designs

Moving Your Business ONLINE?

Contact Us Today!

The Goal:
Sometimes you might want to replace text with an icon in the navigation, or replace the verbiage output of a particular word.

Requirements:

Before

After

jQuery

Add this to your custom scripts.

// Trim Navigation with Icon
    $( ".item_text" ).each(function() {
        //get the text for just the element being iterated over
        var text = $(this).text();
        var comparingText = 'Location';

        if(text == comparingText){
            $(this).replaceWith("<i class="fas fa-map-marker-alt"></i>");
        }
    });

HTML

This is an example of the kind of element you might target.

   <span class="item_text">Location</span>
%d bloggers like this: