how to implement Search function using Javascript or jquery

后端 未结 4 1427
花落未央
花落未央 2020-12-29 15:09

here i write code where all persons names comes from Facebook API . and it is showing on lightbox. now i want to implement search functionality using javasciprt/jquery . Can

4条回答
  •  鱼传尺愫
    2020-12-29 15:21

    Maybe use indexOf method:

    var text ="some name";
    var search = "some";
    
    if (text.indexOf(search)!=-1) {
    
        // do someting with found item
    
    }
    

提交回复
热议问题