I'm new to jQuery and I'm having a problem hiding a <div> element.
I have a form that has a table with numerous lines in it, collecting the input. When I open up this form I want to be able to hide several lines before it is displayed depending on a parameter that has been set previously. Some of the lines are already within a div and I added a new div wrapped around the lines I wanted to hide and gave it a unique id. To test it out I assumed the parameter had been set (I can deal with this part OK) and tried to hide the lines when the page loaded. I thought all I had to do was use $("#unique_id").hide() but it doesn't work and the error console doesn't show any JavaScript errors. If I comment out the div I'm trying to hide the page works OK and shows only the lines that I wanted, without any apparent errors.
Here's a simplified version of the page I'm working on - I've left in some superfluous div's in case this is part of the problem:
In the head, having loaded jScript -
$(document).ready(function() {
$("#unique_id").hide();
});
and in the body -
<table>
<div>
<tr>
<td>Name</td>
<td><input name="name" type="text" id="name" /></td>
</tr>
</div>
<div>
<tr>
<td>Town</td>
<td><input name="town" type="text" id="town" /></td>
</tr>
</div>
<div id="unique_id">
<div>
<tr>
<td>Postcode</td>
<td><input name="postcode" type="text" id="postcode" /></td>
</tr>
</div>
<div>
<tr>
<td>Club</td>
<td><input name="club" type="text" id="club" /></td>
</tr>
</div>
</div>
</table>
Why is this not working?
Thanks
Eric.