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">
	                         <li>
              <h2 class="priceUpdate"> da  €200.00</h2>
            </li>
			<span>
			<li>
				 <h2 class="priceUpdate"><i class="mfcustom-icon-twopay"></i>€193.00</h2>			  
			</li>
			</span>
            			
                      </ul>

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?

thanks
Avatar of badwolfff
badwolfff
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Ah! I forgot!

I also need to change that second h2 in an h5

thanks
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
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.