I have a webpage where i want to have collapsible headings, I have the below code as an example but for some reason it keeps saying that $ is not defined.
<head>
<style>
tr, td
{
border: 1px solid black;
}
tr.header
{
cursor:pointer;
}
</style>
</head>
<body>
<table border="0">
<script>
'use strict';
$('.header').click(function(){
$(this).nextUntil('tr.header').slideToggle(1000);
});
</script>
<tr class=".header">
<td colspan="2">Header</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
</tr>
<tr class=".header">
<td colspan="2">Header</td>
</tr>
<tr>
<td>date</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
</tr>
</table>
</body>
I am wanting when the page loads you just get a list of the headers and then when you click on one it expands