jQuery显示/隐藏不起作用

Gho*_*ast 2 html javascript jquery show-hide

试图看看所有其他问题,为什么这不起作用,没有运气.我在我的标题中加载它:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

这是我的脚本:

$(document).ready(function() {
    $("#knee-tab").hide();
    $("#shoulder-tab").hide();
});
$(function () {
    $("#patient-portal-link").click (function (event) {
        $("#patient-portal-tab").show();
        $("#knee-tab").hide();
        $("#shoulder-tab").hide();
    });
}); 
$(function () {
    $("#knee-link").click (function (event) {
        $("#patient-portal-tab").hide();
        $("#knee-tab").show();
        $("#shoulder-tab").hide();
        }); 
}); 
$(function () {
    $("#shoulder-link").click (function (event) {
        $("#patient-portal-tab").hide();
        $("#knee-tab").hide();
        $("#shoulder-tab").show();
    }); 
});
Run Code Online (Sandbox Code Playgroud)

以下是用于调用脚本的链接:

<ul>
<li><a id="#patient-portal-link">Patient Portal</a></li>
<li><a id="#knee-link">Knee</a></li>
<li><a id="#shoulder-link">Shoulder</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)

然后我有三个div,命名如下:

<div id="patient-portal-tab">Patient portal content</div>
<div id="knee-tab">Knee content</div>
<div id="shoulder-tab">Shoulder content</div>
Run Code Online (Sandbox Code Playgroud)

kneeshoulder的div在页面加载正确隐藏,但链接什么也不做.我正在使用谷歌浏览器,在检查元素时,我没有报告javascript的错误.我究竟做错了什么?

Dan*_* Li 10

#从ID值中删除字符.#jQuery中的字符表示元素的ID,因此您需要两个#(##knee-tab)才能使用它.