javascript - Website search keyword problem

WBOY
Release: 2016-08-18 09:16:18
Original
1025 people have browsed it

If you want to conduct a keyword search on the website, if you see some search keywords in some websites on the Internet, you can make the keywords red and bold, so that users can clearly see at a glance which content contains the search keywords. I would like to ask all the experts, is there any js or css settings that can achieve such a function?

Reply content:

If you want to conduct a keyword search on the website, if you see some search keywords in some websites on the Internet, you can make the keywords red and bold, so that users can clearly see at a glance which content contains the search keywords. I would like to ask all the experts, is there any js or css settings that can achieve such a function?

It means setting a label for the keyword based on the keyword entered by the user, setting the color and font for the label, and replacing the keyword in the search results. I have used a js plug-in before. Please refer to it. It works fine for me. highlight

Replace with regular expressions

Related labels:
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