Sorry, please, if something like this has already been directed me to the desired topic. I’ll just say that I don’t know JavaScript well and I don’t know HTML well. I do now, you can tell by the dictionary. Problem such. Here is the script
<SCRIPT LANGUAGE="JavaScript"> function fun1() { n=0; m1=0; m2=0; m3=0; str1="";str2="";str3="";str4=""; for (var i=0; i<document.all.length; i++) { n=Math.random(); if (document.all.item(i).tagName=="P") {str2=document.all.item(i).innerText; // str2 будет содержать текст последнего найденного абзаца m2=i;} // m2 - номер последнего найденного абзаца if ((document.all.item(i).tagName =="P") && (n>0.7) && (n<0.8)) {str1=document.all.item(i).innerText; // str1 будет содержать текст случайного абзаца или пустой текст m1=i; // m1 - номер случайного абзаца i=document.all.length;} } if (str1=="") {str1=str2; m1=m2}; // если str1 пуст, то str1 примет значение str2, а m1- значение m2 n=1+ Math.round(str1.length/2)*Math.random(); //случайный номер позиции символа в строке m2=str1.indexOf(" ",n)+1; //номер символа, следующего за первым пробелом в строке после позиции n m3=str1.indexOf(" ",m2); //номер первого пробела в строке после позиции m2 str2=str1.substring(m2,m3); // str2 - случайное слово из строки for (i=0; i<str2.length;i++) str3=str3+"*"; //str3 - зашифрованное слово str4=str1.substring(0,m2)+str3+str1.substring(m3,str1.length); // абзац с зашифрованным словом document.all.imgUpr.insertAdjacentHTML("beforeBegin","<P align='left'>"+str4+"</P>"); //вставка в документ абзаца с зашифрованным словом xword=prompt("Какие символы или слово скрыты знаками **** ?",""); //запрос на ввод зашифрованного слова if (str2==xword) alert("Верно!"); else alert ("Неверно. Это слово: "+str2); //проверка и вывод результата i=document.all.imgUpr.sourceIndex; //получение индекса элемента, находящегося после вставленного абзаца document.all.item(i-1).outerText=""; //удаление вставленного абзаца } </SCRIPT>
The meaning of the script: Pulls out a paragraph from the text, pulls a word out of it, inserts asterisks instead of the word, and waits for the user to enter this word. In short, this type of exercise for memory. But I have one module in my hand. Those. I don `t know how to withdraw this whole thing. I know that after launching it shows a window (usually the one into which the url is entered, so as not to scroll the text). I don’t know how to organize all this. Plus, the script also needs to be rewritten, so that it doesn’t get everyone out of the paragraph with the Rend, but the words that you need. For example, there is a definition:
<p><strong>Денежные измерители </strong>используются для обобщенного отражения объектов учета в единой денежной оценке. Необходимо отметить, что отдельные виды имущества и обязательств не подлежат оценке в натуральных и трудовых измерителях, например, денежные средства, дебиторская и кредиторская задолженность, капитал, кредиты и займы.</p>
From it it is necessary to tear out only "Monetary measurements" and not any word. Help please oooooochen need ... Question, almost life and death, I am sewing up with these codes.