单击复选框时,将在jsfiddle上显示文本框但在浏览器上不显示

Good day! Basically, I want a textbox to appear when a checkbox is clicked and disappear when unclicked. Here is the JSFiddle http://jsfiddle.net/GBSZ8/2/ and it works just fine. However, when I saved it as check.php, the text box doesn't appear even if I click the checkbox.

<html>
<head>
<script>
  $('#supplied').live('change', function(){
      if ( $(this).is(':checked') ) {
         $('#date').show();
     } else {
         $('#date').hide();
     }
 });
</script>
</head>
<body>
    <input type="checkbox" name="supplied" id="supplied" value="supplied" class="aboveage2" />

    <ul id="date" style="display:none">
        <li><input id="start" name="start" size="5" type="text" class="small" value="1" /></li>
    </ul>
</body>
</html>


Please help me. Thank you!

You have to include JQuery in your file. Put

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

Above your first tag.

Feel free to change the version number as appropriate or adjust the url to go to a local version of the jquery .js file

You probably need to wrap it in onLoad as well as Paarth's answer.

$(document).ready(function() {