I want to loop through the list artists and each time the button is pressed, I want the next artist to be added in the <p> tag.
let para = document.querySelector('p');
const artists = ['Atif Aslam', 'Nusrat Fateh Ali Khan', 'Kendrick Lamar', 'Travis Scot', 'JCole', 'Sidhu', 'Ataullah EsaKheilvi'];
let info = 'One of my top favorite artist is '
function myArt() {
for (i = 0; i < artists.length; i++) {
para.textContent = info + artists[i];
}
}
<body>
<button id="myArtists" onclick="myArt()"> Click To Find Out!</button>
<p> </p>
</body>