2
Answers

How to check if string contains certain word in JScript

Nicker

Nicker

8y
1.6k
1
y Code
 
var x = document.getElementById("searchbox").value;
if (x.contains('jo')){
 
 
When I run the code I got this error 
Error: Object doesn't support property or method 'contains'
 
apparently I cant use contains, is there other method for it? 
 
Answers (2)