I need to add links to an array of sentences: every time the user will click on the button a sentence from a list will appear. I need to insert to some of the sentences links. how can I do that?
this is the code:
var cnt = 0;
function callMe() {
var Your_Sentences_Array = ['sentence0', 'sentence1', 'sentence2', 'sentence3'];
var div = document.getElementById('idtxt');
div.innerHTML = Your_Sentences_Array[cnt];
cnt == Your_Sentences_Array.length - 1 ? cnt = 0 : cnt++;
}
<div class="game">
<div dir="rtl" class="sentence" id="idtxt"> sentence </div>
<button class="done" type="button" onclick="callMe()">Done!</button>
</div>
for example, I need that when sentence3 will appear it will be clickable and will lead to a different page.
I appreciate any help! thanks : )