jquery - Apply anchor tag to all the h3 tag under a class -


im trying find way add anchor tag h3 tag.the content dynamic in nature .

i want add dynamic anchor tag h3 tags only

<div class="class1">     <h2>main heading</h2>     <h3>heading1</h3>     <h1>some content1</h1>     <h3>heading2</h3>     <h1>some content2</h1>     <h3>heading3</h3>     <h1>some content3</h1> </div> 

i tried below jquery code creating nothing

$("h3.class1").append('<h3>'); var al = $("h3.class1 >");  al.append('<a href="#"></a>'); 

$('div.class1 h3').each(function (){             $(this).wrap('<a />');         }); 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -