why javascript contains property is not working in chrome browser?

前端 未结 6 1301
孤城傲影
孤城傲影 2021-02-01 15:39

Why javascript contains property is not working in chrome browser? I have tried that Contains Property in javascript.It is working fine in Mozila Firefox Browser. But It is

6条回答
  •  盖世英雄少女心
    2021-02-01 16:17

    indexof returns the position of the string. If not found, it will return -1:

    var ClearFilterValue = 'family Schools';
    alert(ClearFilterValue.indexOf("family") != -1);
    

提交回复
热议问题