How to replace tags when using clone()?

Hello !

Assume the following task:

Need to replace only those div tags which are in the container
When cloning replace with span

I saw one example but they produce the data manipulation of the same classes

How suppose to do it with different classes ?

Example:

<div class="container">
 <div class="one">1</div> 
 <div class="two">2</div>
 <div class="third">3</div>
 </div>


$('div').replaceWith(function(){
 return $("<span />").append($(this).contents());
});

So replaced all div on the website
March 19th 20 at 08:33
0 answer

Find more questions by tags HTMLjQueryCSS