I'm looking to add some content inside an existing div.
I'm getting the amount of images contained in another div with the following line
var n = $("div#content img").length;
I've got that element I'm trying to insert content into
<div id="imgCount"></div>
I do know that I can insert the value of my n var into it by doing this
$("#imgCount").text(n);
I do know as well that I can insert HTML into it by doing the following
$('#imgCount').append('<a href="#">sometext</a>');
but I'd like to combine both of them to get the following result :
<div id="imgCount"> <a href="#"> n </a> </div>