[jQuery] Use an id name for a called HTML file
Hi,
I am a newbie to jquery.
Basically, I want to set up a menu on the side. When you click a week
(say id="w2") on the menu, in the DIV next to it, the content from an
HTML document with the same name as the ID of the Week (w2.html) will
be loaded.
<script>
I think this is what I am trying to achieve
$(".month li").click(function(){
$("#info").load("[THE ID OF THE li ITEM].html");
});
});
</script>
<HTML>
<div id="list">
<ul>
<li class="month" id="mar08">March, 2008</li>
<ul>
<li id="4mar08">Week 4</li>
<li id="3mar08">Week 3</li>
<li id="2mar08">Week 2</li>
<li id="1mar08">Week 1</li>
</ul>
<li class="month title" id="feb08">February,
2008</li>
<ul>
<li id="4feb08">Week 4</li>
<li id="3feb08">Week 3</li>
<li id="2feb08">Week 2</li>
<li id="1feb08">Week 1</li>
</ul>
</ul>
</div>
<div id="info"></div>
</HTML>
How do I get the area of [THE ID OF THE li ITEM] to be what I want.
Even another method, where I can alter the html file names. Just
something to save typing a script for every item and HTML file as I'm
sure that's not needed.
Cheers
-Bdiddy