var obj =[ { "name":"龙哥", "url":"www.baidu.com" }, { "name":"龙哥2", "url":"www.baidu.com" }, { "name":"中国北京", "url":"www.baidu.com" }, { "name":"della", "url":"www.baidu.com" } ] var txt = "de" for(var i = 0 ; i < obj.length ; i++){ if(obj[i]["name"].indexOf(txt) > -1){ console.log(i); } }