代码语言:javascript复制
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
</head>
<body>
<script>
var a=prompt("").split("");
var b=prompt("");
var j=0;
for(var i=0;i<a.length;i )
{
if(a[i]===b)
{
j
}
}
console.log(j);
</script>
</body>
</html>