jquery怎么绑定click事件


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

<script type="text/javascript">

$(document).ready(function(){

    $("#text").bind("click",function(){

        alert("我的id为text,你点击时触发");

    });

     

    $("#text1").on("click",function(){

        alert("hellworl");

    });

     

    $("#text2").click(function(){

        alert($("#text2").val());

         

    });

});

     

     

</script>

<body>

     

    <input id="text" type="button" value="点击"/>

     

    <input id="text1" type="button" value="点击"/>

     

    <input id="text2" type="text" value="love"/>

</body>

相关推荐:js教程

以上就是jquery怎么绑定click事件的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

详解jQuery的扩展方法extend

jQuery如何判断radio是否选中

jQuery如何获取标签内容

jQuery中如何实现判断空串

jQuery中的美元符号$有什么作用

jQuery如何使用正则

jQuery怎么添加css样式

vs如何安装jQuery

jQuery prop()和attr()区别是什么

jQuery 元素不可用怎么设置

更多相关阅读请进入《jQuery》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    暂无评论...