Javascript 单击“更多”按钮时放置文本

Javascript 单击“更多”按钮时放置文本,javascript,jquery,Javascript,Jquery,我写了以下内容,用于显示文本,当我单击“更多”链接时,它必须显示剩余的段落。我已经尝试过了,但我不知道为什么它不起作用,能帮我解决这个问题吗 这是我下面的代码 <style> p span { display:none; } </style> <script type="javascript"> $('a').click(function() { $(this).next().show(); retu

我写了以下内容,用于显示文本,当我单击“更多”链接时,它必须显示剩余的段落。我已经尝试过了,但我不知道为什么它不起作用,能帮我解决这个问题吗

这是我下面的代码

    <style>
    p span {
        display:none;
    }

</style>

<script type="javascript">
$('a').click(function() {
    $(this).next().show();
    return false;
});

</script>


<table cellpadding:0px;cellspacing:0px;border=0px; width="100%">
<tr>
<td style="width:20%"><a><button class="choosesub_but comingsoon"> list</button></a></td>

<td style="width:47%;"><p style="font:13px verdana;">A written work—be it an essay or a story—is about an idea or concept. An essay explains it; a story narrates it.<a href="#" style="text-decoration:underline;">More...</a>
<span>all to entertain the reader. All paragraphs support each other, leading the reader from the first idea to the final resolution of the written piece of work.</span></p>
</td>
<td style="width:30%;"><ul class="choosesub_ul"><li><a href="#">Community event</a></li></ul></td>
</tr>
</table>

p跨度{
显示:无;
}
$('a')。单击(函数(){
$(this.next().show();
返回false;
});
所有这些都是为了娱乐读者。所有段落相互支持,引导读者从第一个想法到最终解决书面作品

当我单击“更多”链接时,它必须将输出显示为

无论是文章还是故事,书面作品都是关于一个想法或概念的。一篇文章解释了这一点;一个故事讲述了它。更多…都是为了娱乐读者。所有段落相互支持,引导读者从第一个想法到最终解决书面作品。


<script type="text/javascript">
$(function() {
    $('a').click(function() {
        $(this).next().show();
        return false;
    });
});
</script>
$(函数(){ $('a')。单击(函数(){ $(this.next().show(); 返回false; }); });
如果链接尚未加载,则无法绑定到链接单击事件。因此,我们将该代码放在
document.ready
块中,以便在加载所有内容后执行

脚本类型也应该是
type=“text/javascript”


$('a')。在('click',函数(){
警报(“123”);
$(this.sides().show())
});

那么,您没有向我们展示的其他东西是导致问题的原因@kanya那么你的代码是另外一回事了。你没有给我们看的代码。根据您提供的,这个解决方案是有效的。@kanya您不是很清楚。其实一点也不清楚。两种解决方案都有效。当您实现它们时,它们就不起作用了。向我们展示您的其余代码。“不管用”不足以帮助你。
<script>

        $('a').on('click',function () {
            alert("123");
            $(this).siblings().show()
        });
    </script>