Link to home
Start Free TrialLog in
Avatar of badwolfff
badwolfffFlag 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 badwolfff
Flag of United Kingdom of Great Britain and Northern Ireland image


Ah! I forgot!

I also need to change that second h2 in an h5

Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks! I've learned a new trick or two here thanks to you!
You are most welcome.