Plzはjsfiddleリンクを参照してください。 http://jsfiddle.net/7gbNK/17/
私のコードは次のとおりです。
<form action="" method="POST">
     <table width="50%" cellpadding="4" cellspacing="1" border="1">
         <tr>
             <td width="5%" align="center"><input name="chk_surname" id="chk_surname" type="checkbox" onclick="enable(this.id,'surname')"></td>
             <td width="10%" align="center">Surname</td>
             <td width="35%" style="display:none;" align="center"><input type="text" name="surname" id="surname" value-="surname" /></td>
         </tr>
     </table>
</form>
以下は私のJavascriptです:
<script type="text/javascript">
    function enable(id,name)
    {
        alert("hi");
        $(document).on('change','#'+id, function() 
        {
            var checked = $(this).is(":checked");
            var index = $(this).parent().index();
            if(checked) {
                $('#surname').fadeIn(100);
            }
            else {
                $('#surname').fadeOut(100);
            }
        });
    }
</script>
なぜ私はここで警告を受けていないのですか。前もって感謝します。
