<html>
<input type="hidden" name="keyword" value="<?php echo $result->highlight_keywords; ?>">
<div class="sec_main">
<?phh echo $result->content;?>
</div><!-- section main end -->
<js>
<script src="/static/js/jquery.mark.min.js"></script>
<script>
$(function() {
var keyword = $("input[name='keyword']").val();
var options = {
"className": "match"
};
$(".sec_main").mark(keyword,options);
});
</script>
高亮文字的样式设置
<css>
.match{
color:red;
}
网友评论