<html>
<head>
<style type="text/css">
.res
{
color: Red;
}
.result{
background: yellow;
}
</style>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
var oldKey = "";
var index = -1;
var pos = new Array();
var oldCount = 0;
function previous(){
index--;
index = index < 0 ? oldCount - 1 : index;
search();
}
function next(){
index++;
if(index==oldCount){
index = 0 ;
}
search();
}
function search() {
$(".result").removeClass("res");
var key = $("#key").val();
if (!key) {
console.log("key为空则退出");
$(".result").each(function () {
$(this).r