Good afternoon, help solve the problem, you need to make something like a social questionnaire on the site, the site asks, and the user responds (you just need the string version, no buttons, other fields, etc.), because I just started working with js and tp today, a bunch of questions right away. I started to do with textarea, display the text, but how to count the last one? Tobish, you can like to read like this:
var tex=document.getElementById('tt').value;
but it will take all. Here is what I told you:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Стили</title> </head> <body> <div class="fixed-textarea"> <textarea name ="tt" id="tt" style="height: 100%;width: 100%;" > </textarea></div> <script language="JavaScript"> var text = '>> Сколько лет земле ? \r\n >> ' var i=0; function type(){ i++; if( i <= text.length ) document.getElementById("tt").innerHTML = text.substr(0, i); setTimeout( type, 50 ); } function one(){ var k= Math.random(); var tex=document.getElementById('tt').value; setTimeout( type, 10 ); } type(); </script> </body> </html>