I am trying to add an <a>
tag to a list of li
with the help of jQuery.
The html looks like this:
<div class="level one">
<ul class="kitchen-tools">
<li class="my list"></li>
<li class="my list"></li>
<li class="my list"></li>
</ul>
</div>
I created an empty <a>
tag with jQuery. Unfortunately I can’t find a way to add this <a>
tag to all my <li>
(I tried the jQuery append method).
let aTag = $("a");
$(".my list").append(aTag);
I am new to coding, so I am sure I am doing a silly mistake here. Thanks in advance.