function functiont(){
var a = document.getElementById("q").value;
var b = a.toLowerCase();
var x = b.search("news"||"headline"||"headlines");//is this possible?
if(x != -1){
$("p").text("here are the results");
} else{
$("p").text("sorry");
}
以下のことが可能か、さらに変数を作成してすべてのキーワードを検索する必要がありますか?search()で(または||)を使用できますか?
可能な重複[あなたが.search(と複数の文字列を検索するにはどうすればよい)方法?](のhttp:// stackoverflowの.com/questions/12251197/how-do-you-search-multiple-strings-with-the-search-method) – JJJ