I'm having problems with this bit of jquery. When the page loads, id\_2 is hidden. If I check the check box id\_1 nothing happens. However if I reload the page, id\_2 then shows.

```
<head>
    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">  /script>
</head>

<input id="id_1" type="checkbox" name="ck1">
<input type="text" id="id_2" name="tx1">

<script type="text/javascript">
         $(document).ready(function() {
             if ($('#id_1').is(':checked'))  {
                 ($('#id_2').show());
             } else {
                 ($('#id_2').hide());
             }
});

```

If I use a button and 

```
$("#show_button").click(function()

```

it works - id\_2 shows/hides correctly. I can see in firebug that when I check the checkbox the checked value toggles from true / false.

What am I doing wrong?

Oli