Avatar of badwolfff
Flag for United Kingdom of Great Britain and Northern Ireland asked on

How do I detect a certain word in one span and apply it to another span using jQuery?

I have a dynamically generated code that resembles this:
<ul class="list-unstyled col-lg-12 no-padding">
              <h2 class="priceUpdate"> da  €200.00</h2>
				 <h2 class="priceUpdate"><i class="mfcustom-icon-twopay"></i>€193.00</h2>			  

Open in new window

I need to detect if in the h2.priceUpdate the string " da  " is present and if so insert it just after the <i class="mfcustom-icon-twopay"></i>

Could anyone help me work out how to achieve this via jQuery?


Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon

Ah! I forgot!

I also need to change that second h2 in an h5

Julian Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thanks! I've learned a new trick or two here thanks to you!
Julian Hansen

You are most welcome.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy