<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>zy</title>
<script type="text/javascript">
window.οnlοad=function(){
var one='I like red and black';
var two='she likes black';
var reg='black';
if(one.search(reg) && two.search(reg)){
alert('true');
}else{
alert('false');
}
}
</script>
</head>
<body>
字符串1:“I like red and black”;
<br>
字符串2:“she likes black”;
<br>
判断字符串中是否存在black
</body>
</html>