Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery if variable contains text

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

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

PREVIOUS NEXT
Code Example
Javascript :: javascript get a random number with 6 digits 
Javascript :: where to put js files in flask 
Javascript :: generate secret key js Java Script 
Javascript :: current time in javascript 
Javascript :: React Navigation back() and goBack() not working 
Javascript :: js reverse array of objects 
Javascript :: jquery add event listener to ckeditor 
Javascript :: visual code put quotes to each line 
Javascript :: join last element of array javascript with different value 
Javascript :: multi-stage Dockerfile for Node.js 
Javascript :: circle button react native 
Javascript :: set default terminal vscode windows 
Javascript :: set defaultValue for select element jsx 
Javascript :: instance use in_array in javascript 
Javascript :: pipefy api card search field 
Javascript :: how to convert char to number in js 
Javascript :: angular find value in json array 
Javascript :: react native set default ios simulator 
Javascript :: border radius not working ios react native 
Javascript :: importing react 
Javascript :: modulo do angular httpclient 
Javascript :: stampare una variabile in javascript 
Javascript :: random js 
Javascript :: jquery get 
Javascript :: less than or equal js 
Javascript :: sum an array in javascript 
Javascript :: how to clear innerhtml in javascript 
Javascript :: make url clickable js 
Javascript :: jquery modal on show + target button 
Javascript :: input text react 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =