<!DOCTYPE html>
<html>
<head>
<title>Подсчитать количество четных цифр в строке</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>
<body>
<script type="text/javascript">
function String()
{
var str=document.form1.textin.value;
var count = 0;
for (i =0; i < str.length; i++)
{
if (str[i] % 2 == 0)
{
count++;
}
}
alert(count);
</script>
<form name="form1">
Введите текст:<br>
<textarea name="textin" rows=4 cols=75%></textarea><hr>
<input id="button" type="button" value="Опpeдeлить" onClick="String()">
<input type="reset" value="Отменить">
</form>
</body>
</html>