can anyone suggest a good method to create a link around an image using DOM.
i have tried the following code. but it is not working.

Code:
               
		var linkTag    =  document.createElement("a");
			 linkTag.href    = hLink;
			 linkTag.title    = title;
			 linkTag.target = "_blank";
			 itemDiv.id       = 'link-1';
		itemDivRef.appendChild(linkTag);

		// Image
		var linkId =  'link-1';
		var linkRef= $(linkId);
		var imgTag    =  document.createElement("img");
		imgTag.setAttribute('src','http://www.mysite.com/abc.jpg');
		inkRef.appendChild(imgTag);
while using this code, the image is not coming inside the anchor tag. it is displaying like below

HTML Code:
<a href="some link' /><img src="something"/>
i want it like below.

HTML Code:
<a href="some link' ><img src="something"/> </a>
thanks,
codlib