标签:position bsp inner document while java sdh .com demo
1 <script>
2 var txt="ABCDEFGHIJKLMNOPQRSTUVWXYZvshjkdjlksdhbasndhbawnieoqawinsbdvhzohcvikzbncxiouj";
3 var index=0,count=0,position=0;
4 index = txt.indexOf("h",position);
5 document.getElementById("demo").innerHTML=index;
6 while(index!=-1){
7 count++;
8 position = index + 1;
9 index = txt.indexOf("h",position);
10 }
11 document.getElementById("demo").innerHTML=count;
12 </script>
摘自https://www.cnblogs.com/ghostang/
标签:position bsp inner document while java sdh .com demo
原文地址:https://www.cnblogs.com/xxjb/p/9867015.html