put H2 between Div jQuery -


i have this

<h2></h2> <h2></h2> <h2></h2> <h2></h2> 

i want using jquery if can please

<div class="dotted">      <h2></h2> </div>  <div class="dotted">      <h2></h2> </div>  <div class="dotted">      <h2></h2> </div>  <div class="dotted">      <h2></h2> </div> 

try this, use .wrap()

$('h2').wrap('<div class="dotted"></div>') 

demo


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -