Can below jQuery be amended so that instead of appending to the generic .myCss style I can append to the css within the specific div ‘myDiv’ ?
var myDiv= $("#myDiv");
$('<a class=\".newCss\" href=\"#\"></a>').appendTo('.myCss');
By append to css I mean the div gets converted from this :
<div id="myId" class="myCss">
</div>
to this :
<div id="myId" class="test">
<a class="myCss"></a>
</div>
Just change the selector.
Alternative, since you have a reference to it already, just pass the jQuery object you created using that selector earlier.
Since the question has been rewritten:
.in the class name, don’t put one in itSuch: