I have following html and want to wrap with javascript or jquery a div around all li’s (its not definied how many li’s there are)
<div class='example1'>
<div class='example2'>
<h1>Test</h1>
<div class='example3'>
<li></li>
<li></li>
...
<li></li>
<li></li>
</div>
The Result should look like
<div class='example1'>
<div class='example2'>
<h1>Test</h1>
<div class='example3'>
<div class='lis'>
<li></li>
<li></li>
...
<li></li>
<li></li>
</div>
</div>
I’m not able to add anything else the existing html 🙁
Can you please help me?
You could use wrapAll :
But the HTML norm specifies that
LIelements are only permitted inUL,OLandMENU, notDIV.Demonstration