I have created an image tag in JQuery. Now I need to add one more anchor tag with it. How can I implement it with JavaScript?
I tried this:
var imgg = document.createElement("img");
imgg.className='myclass';
$( ".myclass" ).add( "<a href="#">Test</a>" );
but it isn't working. It should appear as:
<img src=""><a href="#"></a>
Which function should I use to add one more anchor tag within img tag?
<a href="#"><img src=""></a>