How do I do this one in jquery? Say I have
<div class = "container">
The requested quantity for "ITEM" is not available
<span>Other word</span>
</div>
if the container has this phrase "The requested quantity for" then wrap the entire sentence in
<h1></h1>
this will be the output:
<div class = "container">
<h1>The requested quantity for "ITEM" is not available</h1>
<span>Other word</span>
</div>
THANKS :)
you can try this:-
or you can also use wrapInner:-
Answer for updated question:-
Demo for wrapInner
Demo