カレンダーと「Today in Weather History」情報を含む html ファイルがあります。誰かがカレンダーの特定の日をクリックするまで、すべての気象履歴を非表示にして、その日の履歴のみを表示したいと考えています。
毎日の天気情報は非表示になっていますが、暦日をクリックしても特定の日は表示されません。私はこれについてすべて間違っていると思います。それについてのより良い方法をいただければ幸いです。
暦日リンク:
<td align="right"><a id="c0408" href="#"> 8</a></td>
気象履歴:
<div id="allhistory">
<div id="hc0408" style="display:none">
<ul>
<li class="dateheader">April 8, 2007</li>
<li>The Savannah Airport drops to 28 degrees, its lowest April
temperature.</li>
<li class="dateheader">April 8, 2007</li>
<li>Summerville has their coldest April temperature, when the mercury
falls to 27 degrees.</li>
</ul>
</div>
<div id="hc0409" style="display:none">
<ul>
<li class="dateheader">April 9, 2011</li>
<li>Severe thunderstorms impact Berkeley County in South Carolina,
with hail as large as tennis balls (2.5 inches) and winds as
high as 64 mph.</li>
</ul> <!-- 0409 -->
</div>
</div> <!-- all history div -->
jQuery コード:
<script>
$(document).ready(function() {
$('#calendar a').click(function() {
var dateid = $(this).attr('id');
var selection = "div#h"+dateid;
$("selection").show();
})
});
</script>