js搜索列表关键词高亮
$('.inputGroup input').bind('input propertychange', function(e) {
let value = e.target.value
// 列表循环
$.each($('.used-all .J_menuItem'), function (i, v){
if($(v).html().indexOf("<span") !== -1){
$(v).html($(v).html().replace('<span style="color: #F5073F">', ''))
$(v).html($(v).html().replace("</span>", ''))
}
if($(v).html().indexOf(value) !== -1 && value !== ''){
let newVal = $(v).html().replace(value, "<span style='color: #F5073F'>" + value + "</span>")
$(v).html(newVal)
}
})
})