js搜索關(guān)鍵字高亮 angularjs實(shí)現(xiàn)搜索的關(guān)鍵字在正文中高亮出來?
angularjs實(shí)現(xiàn)搜索的關(guān)鍵字在正文中高亮出來?var oldKey=“”函數(shù)showKey(allStr,keyStr){if(oldKey!=""){ 所有str.replac
angularjs實(shí)現(xiàn)搜索的關(guān)鍵字在正文中高亮出來?
var oldKey=“”函數(shù)showKey(allStr,keyStr){if(oldKey!=""){ 所有str.replace(“<font color=”ff0000“>”oldKey“</font>”,oldKey)}如果(keyStr!=""){ 所有str.replace(keyStr,“<font color=”ff0000“>”keyStr“</font>”)oldKey=keyStr}