duangua6912 2011-07-22 13:23
浏览 35
已采纳

从td调用jQuery

i have created a table with a row and 4 columns.i declared attributes class,id for td element. when i click on the td i have to call the jQuery function to load pop up box. here instead load pop up i just want to display the alert box but it doesn't work. here is my code

jQuery

    <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript">
     $(document).ready(function(e) {
                alert("jquery");
                $('.tbox').click(function(e) {
            tb_show("ThickBox","hi.html?height=120&width=400","true");  
            }
    });

</script>

html code:

<table>
<tr align="center">
<td class="tbox" id="tbox"> <?=$id?> </td>
<td class="tbox" id="tbox"><?=$zoneName?></td>
</tr></table>

how to call the jQuery?

  • 写回答

3条回答 默认 最新

  • dounuogong0358 2011-07-22 13:26
    关注
    $(document).ready(function (e) {
      $('.tbox').click(function (e) {
        alert("jquery");
      });
    });
    

    is this what you were asking?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?