试试这个代码它对我有用
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
for(var i=1;i<=10;i++){
$("#test"+i).css('display','none');
}
for(var i=4;i<=8;i++)
{
$("#test"+i).css('font-family','Rupee Foradian,Verdana,Arial,Helvetica,sans-serif');
$("#test"+i).css('font-weight','bold');
$("#test"+i).css('display','block');
}
});
});
</script>
</head>
<body>
<li class="link" id="test1">one</li>
<li class="link" id="test2">two</li>
<li class="link" id="test3">three</li>
<li class="link" id="test4">four</li>
<li class="link" id="test5">five</li>
<li class="link" id="test6">six</li>
<li class="link" id="test7">seven</li>
<li class="link" id="test8">eight</li>
<li class="link" id="test9">nine</li>
<li class="link" id="test10">ten</li>
<button>Click me</button>
</body>
</html>