Home >Web Front-end >JS Tutorial >How to highlight keywords in javascript under firefox_javascript skills

How to highlight keywords in javascript under firefox_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:11:161300browse
Copy code The code is as follows:

Under IE:
var range = document.createRange() ;
FireFox has:
var range = document.body.createTextRange();

There is findText and pasteHTML under IE, but not under fireFox! what to do? After checking a lot of information, I couldn't tell the reason. Huangtian paid off and finally let me figure it out!

Note: I am not using regular replacement here, because regular replacement has its shortcomings!

I don’t know if anyone has studied this method before.

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn