Ecommerce Shopify WordPress Discussion

Insert icon in Shopify menu using Jquery

I'm trying to add icon in my Shopify menu like this : The menu I want with icons before titles The only way I found for adding icon to Shopify header menu is to use Jquery. So I added Jquery script to my theme.liquid and I've followed the steps in this video but the script won't work. Here's the script : <script> $('#HeaderMenu-fleurz').text(function(){ var navText = $(this).text(); $(this).prepend('<img scr=""/>'); } }); </script> And here's the inspector on the item : My Shopify website now Sorry I'm not an English native, and thanks a lot for your help ! I tried some homemade script but I'm not js dev, nor dev at all so nothing would work ?
Explanation Hi, it'll be good if you could post your html code together, so we can understand your issue better. I guess you are trying to prepend the element into the menu header Code <script> var imgsrc = $("<img>").attr("src", "") $('#HeaderMenu-fleurz').prepend(imgsrc); </script>

December 30, 2023

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.