标签:undefined keyword console ++ eid lag txt repo define
var flag1 = $("#keyword").val() != undefined; var flag2 = $("#keyword").val() != null; var flag3 = $("#keyword").val() != ‘‘; if ( flag1&&flag2&&flag3) { var keyword=$("#keyword").val(); var reg = new RegExp(txtReportName, ‘ig‘); var tableId = document.getElementById("table"); if (keyword!= null) { for (var i = 1; i < tableId.rows.length; i++) { for (var j = 1; j < tableId.rows[i].cells.length; j++) { var bb = tableId.rows[i].cells[j].innerHTML; console.log(bb); var displayColor = ‘<span style="color:#4e55ff">‘ + keyword+ ‘</span>‘; var cc = bb.replace(reg, displayColor); tableId.rows[i].cells[j].innerHTML = cc; } } } }
完
标签:undefined keyword console ++ eid lag txt repo define
原文地址:https://www.cnblogs.com/liouzeshuen/p/10539704.html