Answer the question
In order to leave comments, you need to log in
How to open html document on iphone from "files" folder using chrome or safari?
There is an html document that contains a default doctype and code with a JS script in the body tag to generate random expressions, below is a shortened version:
<body>
<p id="text"></p>
<input id="generate" type="button" value="Сгенерировать" />
<script>
function init() {
var text = function makePhrases() {
var words1 = ["Товарищи,", "С другой стороны", "..."];
var words2 = ["реализация намеченных плановых заданий", "есть сроки", "..."];
var rand1 = Math.floor(Math.random() * words1.length);
var rand2 = Math.floor(Math.random() * words2.length);
var phrase =
words1[rand1] +
" " +
words2[rand2] +
"!";
return phrase;
};
document.getElementById("generate").onclick = function () {
document.getElementById("text").innerHTML = text();
};
}
window.onload = init;
</script>
</body>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question