I want to split text to control it with html <span>
This my html code
<div class="siteLabel">Gallery/Technology/Music/Video/Business/Nature/People/Sports/Car/Fashion/Learn/Typography</div>
the result should be like this
<div class="siteLabel">
<span>Gallery</span>
<span>Technology</span>
<span>Music</span>
<span>Video</span>
<span>Business</span>
<span>Nature</span>
<span>People</span>
<span>Sports</span>
<span>Car</span>
<span>Fashion</span>
<span>Learn</span>
<span>Typography</span>
</div>
The problem is that the labels number not static it may be more or less, so i can't use something like .split('/')
.split('/')?.split('/')require select every label by it's number Gallery [0] , Technology [1] and so on. but this text of labels not static it may changed so i can't select it using numbers.