var text = "hello world"; var term = "hello"; if( text.indexOf( term ) != -1 ){ alert("true"); } else{ alert("false") }