jquery笔记1

Posted on 2012-05-16 13:34  洪庸  阅读(76)  评论(0)    收藏  举报
<input type="button" value="getmd5" id="a1" />
<input type="button" value="getmd5" id="a2" />
<input type="button" value="getmd5" id="a3" />

</body>
<script>
    $('input').bind('click',function(){
        //alert(event.currentTarget.id);//a1
        //this == event.currentTarget //true
        alert(this.id);
    });


可以采用这种绑定策略,取到dom元素的id值


版权声明:本文为博主原创文章,未经博主允许不得转载。

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3