The code copy is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<!-- Introducing jQuery -->
<script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
<script type="text/javascript" >
//<![CDATA[
$(function(){
var $div_li =$("div.tab_menu ul li");
$div_li.click(function(){
$(this).addClass("selected") //The current <li> element is highlighted
.siblings().removeClass("selected"); //Remove the highlights of other peer <li> elements
var index = $div_li.index(this); // Get the index of the currently clicked <li> element in all li elements.
$("div.tab_box > div") //Select child nodes. If the child node is not selected, an error will be caused. If there is a div in it
.eq(index).show() //Show the <div> element corresponding to the <li> element
.siblings().hide(); //Hide several other <div> elements of the same generation
}).hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
})
})
//]]>
</script>
</head>
<body>
<div>
<div>
<ul>
<li>Current Affairs</li>
<li>Sports</li>
<li>Entertainment</li>
</ul>
</div>
<div>
<div>Current Affairs</div>
<div>Sports</div>
<div>Entertainment</div>
</div>
</div>
</body>
</html>