Problem :
I have list in HTML, 5 li > a inside ul and I created array in JS such as :
var list= [
{
date: "02.2013",
name: "First",
icon: "fa fa-heart"
},
{
date: "05.2014",
name: "Second",
icon: "fa fa-flask"
},
{
date: "03.2012",
name: "Third",
icon: "fa fa-gavel"
},
{
date: "06.2015",
name: "Fourth",
icon: "fa fa-graduation-cap"
},
{
date: "08.2017",
name: "Fifth",
icon: "fa fa-trophy"
}];
and i want to add "ICON" content as classes to a. Result should be sth like that :
<ul>
<li>
<a href="#" class="fa fa-heart" aria-hidden="true"></a>
</li>
<li>
<a href="#" class="fa fa-flask" aria-hidden="true"></a>
</li>
<li>
<a href="#" class="fa fa-gavel" aria-hidden="true"></a>
</li>
<li>
<a href="#" class="fa fa-graduation-cap" aria-hidden="true"></a>
</li>
<li>
<a href="#" class="fa fa-trophy" aria-hidden="true"></a>
</li>
</ul>
I can display in console every "ICON" in table, same with "a" but I have no idea what should be next step
How can I take these "classes" from array and put it inside links?
for / foreach ??
I ask for hints, not for solutions - thanks for every comment bros