Use .show() method by jQuery 3.0
.show() メソッドを実行しても要素が表示されない例です。
by hideki_a
HTML
<div id="test">
<p>テストです。</p>
</div><!-- /#test -->
<div>
<button id="btn-01">Show</button>
</div>
CSS
p{
margin: 0;
}
#test{
display: none;
margin-bottom: 20px;
width: 200px;
height: 150px;
background-color: #efefef;
}
JavaScript
(function ($) {
$("#btn-01").on("click", function () {
$("#test").show(); // CSSでdisplay: none;しているので、実行しても表示されない。
});
}(jQuery));