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

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -