I was trying some jQuery code and my show()
function doesn't seem to work.
here is my jQuery code:
$("button").click(function(){
$("#dropdown").show();
});
The link to the fiddle.
I was trying some jQuery code and my show()
function doesn't seem to work.
here is my jQuery code:
$("button").click(function(){
$("#dropdown").show();
});
The link to the fiddle.
没有元素被访问$("button")
添加id="button"
到按钮元素并将jquery更改为$("#button")
请在提出此类问题之前进行更多研究。
在按钮前添加#
$("#button").click(function(){
$("#dropdown").show();
});
你确定你有正确的 jquery 版本吗?或者您可能应该替换https://
orhttp://
到//
例如<script type="text/javascript" src="//yourplugin.js"></script>
,如果您有多个包含该特定内容的 div,如果这不起作用,您应该对您的工作进行一些交叉检查id
!$("div#youdivid).show();