你能告诉我我的代码有什么问题吗?我已经给出了以下所有部分的代码;HTML/CSS 和 JQuery
当我单击 go veg 按钮时,鱼类应该隐藏。
CSS 文件
div{
display:inline;
float:left;
height:245px;
text-align:left;
border: solid #000 3px;
}
.html 文件
<html>
<head>
<link rel="stylesheet" type="text/css" href="file://c:/jquery/chapter-2/begin/styles/my_style.css" />
<script src="file://c:/jquery/chapter-2/begin/scripts/jquery.js" type="text/javascript"></script>
<script src="file://c:/jquery/chapter-2/begin/scripts/my_scripts.js" type="text/javascript"></script>
</head>
<body>
<div class="topper">
<h2>Our Menu</h2>
<div class="buttons"><button type="submit" value="vegon">Go Vegetarian</button></div>
<div class="buttons"><button type="submit" value="restoreme">Restore Menu</button></div>
</div>
<div class="middle">
<li>Thai-style Halibut
<ul class="menu_list">
<li >coconut milk</li>
<li class="fish" >pan-fried halibut</li>
<li >lemongrass broth</li>
<li >vegetables</li>
<li >Thai spices </li>
</ul>
</li>
<li>Braised Delight
<ul class="menu_list">
<li class="meat" >lamb shoulder</li>
<li >cippolini onions</li>
<li >carrots</li>
<li >baby turnip</li>
<li >braising jus</li>
</ul>
</li>
<li>House Grilled Panini
<ul class="menu_list">
<li class="meat" >prosciutto</li>
<li >provolone</li>
<li >avocado</li>
<li >cherry tomatoes</li>
<li >sourdough roll</li>
<li >shoestring fries </li>
</ul>
</li>
<li>House Slider
<ul class="menu_list">
<li >eggplant</li>
<li >zucchini</li>
<li class="hamburger">hamburger</li>
<li >balsamic vinegar</li>
<li >onion</li>
<li >carrots</li>
<li >multigrain roll</li>
<li >goat cheese</li>
</ul>
</li> <li>Frittata
<ul class="menu_list">
<li class="meat" >eggs</li>
<li >Asiago cheese</li>
<li >potatoes </li>
</ul>
</li>
<li>Coconut Soup
<ul class="menu_list">
<li >coconut milk</li>
<li class="meat" >chicken</li>
<li >vegetable broth</li>
</ul>
</li>
<li>Soup Du Jour
<ul class="menu_list">
<li class="meat" >grilled steak</li>
<li >mushrooms</li>
<li >vegetables</li>
<li >vegetable broth </li>
</ul>
</li>
<li>Hot and Sour Soup
<ul class="menu_list">
<li >roasted pork</li>
<li >carrots</li>
<li >Chinese mushrooms</li>
<li >chili</li>
<li >vegetable broth </li>
</ul>
</li>
<li>Avocado Rolls
<ul class="menu_list">
<li >avocado</li>
<li >whole chiles</li>
<li >sweet red peppers</li>
<li >ginger sauce</li>
</ul>
</li>
</div>
</body>
</html>
js文件
$(document).ready(function() {
$(".buttons").click(function(){
$("li.fish").hide();
});
});