<!DOCTYPE html>
<html>
<head>
<script>
var counter = 0;
function myfunc1()
{
var elem = document.getElementById("para1");
var txt1 = elem.innerHTML;
var txt2 = "";
for (var i = 0; i<txt1.length;i++)
{
if (i == counter)
{
txt2 +=txt1.charAt(i).toUpperCase();
continue;
}
txt2 +=txt1.charAt(i);
}
elem.innerHTML = txt2;
counter++;
if (counter ==txt1.length)
{
elem.innerHTML = txt1.toLowerCase();
counter = 0;
}
}
</script>
</head>
<body onload="setInterval('myfunc1()', 1000)" style="font-size:25px;">
<p id="para1">привет</p>
</body>
</html>
|