发布网友 发布时间:2022-04-24 03:10
共3个回答
热心网友 时间:2022-04-24 04:39
<script type="text/javascript">
var arr = [ "America", "Greece", "Britain", "Canada", "China", "Egypt" ];
function method1() {
for (a in arr) {
var str=arr[a];
if(method2(str,"a","A")){
document.write("<font color='red'>"+str+"</font><br>")
}
}
}
function method2(strs,s1,s2){
if(strs.indexOf(s1)!=-1||strs.indexOf(s2)!=-1){
return true;
}
return false;
}
method1();
</script>
热心网友 时间:2022-04-24 05:57
var countryList=["America","Greece","Britain","Canada","China"];热心网友 时间:2022-04-24 07:32
自己刚刚开始学JS,有很多不足之处望见谅。