There is an array of random phrases when you click on a button, it gives a random array from the array. Question: How to create a txt file using JS or HTML5 or jQuery when you click on a link with a phrase, I didn’t even find anything close on the Internet. Help plz at least with the literature on this topic, the sample code would be absolutely magical!
Here is the array code >>
function my_alert() { var text = ["Сегодня прекрасный день", "Вам определённо повезёт", "Не грусти. Всё будет хорошо", "Улыбнись", ":) :) :)", "Ты сегодня лучше всех"]; min = 0; max = text.length-1; out = Math.floor(Math.random()*(max-min+1))+min; document.getElementById("text").innerHTML = text[out]; } <p>Случайная фраза:</p> <a href="#"><p id="text"></p></a> <button id="ok" onClick="my_alert()">ОК</button>