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
Release: 2016-05-16 19:11:16
Original
1299 people have browsed it
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
]
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template