I've got a script that I want to include a html file based on the list item's id.
I've got two list items
<ul class="fruits">
<li id="0">Apples</li>
<li id="1">Pears</li>
</ul>
Now here's my script so far. Basically I want to check the id
of the selected list item and insert a html file with a description of that fruit.
Script is
$(document).ready(function() {
$(".fruits li").click(function() {
if(this.id == "0") {
$(".fruit_copy").load("blocktext/apple.html");
}
});
});
And I want this <div class="fruit_copy"> </div>
to be populated with the HTML
content. But of course it's not working.