jQuery
文章平均质量分 70
joe_dev
这个作者很懒,什么都没留下…
展开
-
jQuery获取清空input值的几种方法
$('.class').val()$(" #id").val()$(" input[ name='name' ] ").val()$(" input[ type='text' ] ").val()$(" input[ type='text' ]").attr("value")通过选择器选择对应元素.val()清空文本框的值$(" #id").val(“”);如果此时console.log(原创 2016-12-13 10:11:34 · 131106 阅读 · 8 评论 -
jQuery动态生成html元素的几种方法
本文实例讲述了jQuery动态创建html元素的常用方法,在使用jQuery进行WEB程序设计的时候非常有用。分享给大家供大家参考。具体方法如下:一般来说,可以通过以下几种方式动态创建html元素:1、使用jQuery创建元素的语法 2、把动态内容存放到数组中,再遍历数组动态创建html元素 3、使用模版1.使用jQuery动态创建元素追加到jQuery对象转载 2016-12-14 14:38:17 · 8329 阅读 · 0 评论 -
jQuery的on()
jQuery on()方法是官方推荐的绑定事件的一个方法。$(selector).on(event,childSelector,data,function,map)由此扩展开来的几个以前常见的方法有.bind() $("p").bind("click",function(){ alert("The paragraph was clicked."); });转载 2016-12-14 11:51:04 · 355 阅读 · 0 评论