Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery if variable contains text

var text = "hello world";
var term = "hello";

if( text.indexOf( term ) != -1 ){
  alert("true");
} else{
	alert("false")
}
 
PREVIOUS NEXT
Tagged: #jquery #variable #text
ADD COMMENT
Topic
Name
6+2 =